![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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) |
| | 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) |
| | 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) |
| | 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 | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Datagrid Image Button Select Column | .NET General | |||
| Background Image for each folder type not showing. | General Discussion | |||
| Signature Image not showing in some replys...? | Vista mail | |||