Set Image to Button
-
Hello Experts, I am using System.Windows.Controls.Button and want to set image to button or background as a image.However i didn't find image property to button.I use following code but still not working.My main aim is setting up an image. Thanks.
-
Hello Experts, I am using System.Windows.Controls.Button and want to set image to button or background as a image.However i didn't find image property to button.I use following code but still not working.My main aim is setting up an image. Thanks.
Um. I did:
Button myButton = new Button();
myButton.Image = Image.FromFile(@"D:\Temp\MyPic.jpg");I don't know where you are looking, but it isn't in the Button properties... :laugh:
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
-
Um. I did:
Button myButton = new Button();
myButton.Image = Image.FromFile(@"D:\Temp\MyPic.jpg");I don't know where you are looking, but it isn't in the Button properties... :laugh:
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
-
I am not able to find Image property of Button. I searched on google too but i didn't get anything. I am working with WPF and C#.
If you are using WPF, then please make it clear in the question! :laugh: I'm surprised you couldn't find anything with Google: I did. Google[^] http://blogs.msdn.com/b/knom/archive/2007/10/31/wpf-control-development-3-ways-to-build-an-imagebutton.aspx[^]
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
-
Hello Experts, I am using System.Windows.Controls.Button and want to set image to button or background as a image.However i didn't find image property to button.I use following code but still not working.My main aim is setting up an image. Thanks.
Try WPF Button with Image[^]
-
Hello Experts, I am using System.Windows.Controls.Button and want to set image to button or background as a image.However i didn't find image property to button.I use following code but still not working.My main aim is setting up an image. Thanks.
And just FYI there's a Silverlight/WPF board[^] for Silverlight/WPF questions. :)
Mark Salsbery :java: