By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,870 Members | 2,400 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,870 IT Pros & Developers. It's quick & easy.

Place an Image on a button WPF

P: 81
Hey All,
I want to store an image in a resource, and then use this image on a button. But I can't seem to get this working. In WPF should I be using resources to store the icons? Or should this be done differently?

Edit: I have Added a png to my Resources, and then in XAML tried:

Expand|Select|Wrap|Line Numbers
  1.                <comp:CFButton x:Name="btnScreenUp">
  2.                     <Image Source="Resources/UpScreen.png"/>
  3.                 </comp:CFButton>
But this fails to compile. Atleast is says it does. If I run the works. This is very bizarre. Any thoughts?

Also, the button is within a frame, and the frame is referenced within a window. In the window, the button shows up right, but when I look at the Frame xaml, it complains of an error and won't render.
Jan 8 '09 #1
Share this Question
Share on Google+
1 Reply

P: 81
Nevermind, closing and reopening VS fixed the issue.
Jan 8 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.