![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Button with Image not showing in XAML I am not pretty much new to XAML and I am trying to create a solution which has buttons with image as background and I am using the following syntax, and it is not showing up. Also if feasible can somebody guide me how I can reference these directly from resource file. <Button> <Image Source="Resources\Images\Select.png"></Image> </Button> Thanks Atul |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: Button with Image not showing in XAML In WPF, images must be embedded as Resource - type items. This is different from the WinForms way to use the Resources.resx. I usually create a folder, say 'Images' in my project - this creates a file folder with the same name on disk, then copy the image(s) into this folder (using windows explorer). Then, go back to Visual Studio. In the project view, right-click on the 'Images' folder and choose 'Add Existing Item' to add the image as a resource (shows as Build Action : Resource in the properties window). Then simply use e.g. Image Source="Images/mypicture.jpg" im XAML and it should work. "Atul Bahl" wrote: > I am not pretty much new to XAML and I am trying to create a solution which > has buttons with image as background and I am using the following syntax, > and it is not showing up. Also if feasible can somebody guide me how I can > reference these directly from resource file. > > <Button> > <Image Source="Resources\Images\Select.png"></Image> > > </Button> > > > > Thanks > > Atul > > > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: Button with Image not showing in XAML Thanks for replying as I was thinking nobody looks at this news group. Anyway I followed your recommended approach and it still does not work. I am working again June CTP version of windows SDK. Also I have noticed none of the samples included with the Windows SDK using WPF is able to display images. Not sure whether that is a bug in June CTP or what. Would definitely appreciate any guidance. "WolfgangB" <WolfgangB@discussions.microsoft.com> wrote in message news:C4361D68-3B95-4F38-BEF2-1B28F9FBAAFE@microsoft.com... > In WPF, images must be embedded as Resource - type items. This is > different > from the WinForms way to use the Resources.resx. > I usually create a folder, say 'Images' in my project - this creates a > file > folder with the same name on disk, then copy the image(s) into this folder > (using windows explorer). Then, go back to Visual Studio. In the project > view, right-click on the 'Images' folder and choose 'Add Existing Item' to > add the image as a resource (shows as Build Action : Resource in the > properties window). > Then simply use e.g. Image Source="Images/mypicture.jpg" im XAML and it > should work. > > > "Atul Bahl" wrote: > >> I am not pretty much new to XAML and I am trying to create a solution >> which >> has buttons with image as background and I am using the following syntax, >> and it is not showing up. Also if feasible can somebody guide me how I >> can >> reference these directly from resource file. >> >> <Button> >> <Image Source="Resources\Images\Select.png"></Image> >> >> </Button> >> >> >> >> Thanks >> >> Atul >> >> >> |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: Button with Image not showing in XAML Hi, I think problem could be related to WIC version, to fix : http://msdn.microsoft.com/windowsvis...lt.aspx#topic2 I'm going to try as per link; Good luck. "Atul Bahl" wrote: > Thanks for replying as I was thinking nobody looks at this news group. > > > > Anyway I followed your recommended approach and it still does not work. I am > working again June CTP version of windows SDK. Also I have noticed none of > the samples included with the Windows SDK using WPF is able to display > images. > > > > Not sure whether that is a bug in June CTP or what. Would definitely > appreciate any guidance. > > > > "WolfgangB" <WolfgangB@discussions.microsoft.com> wrote in message > news:C4361D68-3B95-4F38-BEF2-1B28F9FBAAFE@microsoft.com... > > In WPF, images must be embedded as Resource - type items. This is > > different > > from the WinForms way to use the Resources.resx. > > I usually create a folder, say 'Images' in my project - this creates a > > file > > folder with the same name on disk, then copy the image(s) into this folder > > (using windows explorer). Then, go back to Visual Studio. In the project > > view, right-click on the 'Images' folder and choose 'Add Existing Item' to > > add the image as a resource (shows as Build Action : Resource in the > > properties window). > > Then simply use e.g. Image Source="Images/mypicture.jpg" im XAML and it > > should work. > > > > > > "Atul Bahl" wrote: > > > >> I am not pretty much new to XAML and I am trying to create a solution > >> which > >> has buttons with image as background and I am using the following syntax, > >> and it is not showing up. Also if feasible can somebody guide me how I > >> can > >> reference these directly from resource file. > >> > >> <Button> > >> <Image Source="Resources\Images\Select.png"></Image> > >> > >> </Button> > >> > >> > >> > >> Thanks > >> > >> Atul > >> > >> > >> > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is it possible to include XAML files into another XAML file? | star-italia | .NET General | 6 | 06-12-2008 04:56 AM |
| Signature Image not showing in some replys...? | DaisyP | Vista mail | 0 | 03-20-2008 04:36 PM |
| Data binding of Button.Content to an image in a XML island does not work | muchinger@web.de | Avalon | 1 | 04-17-2007 11:06 AM |
| Button with regular image and disabled image | loumfranco@gmail.com | Avalon | 1 | 05-31-2006 02:47 PM |
| How to make UI controls like button,TextBox 3d using XAML. | Enigmatic | Avalon | 0 | 02-24-2006 04:11 PM |