Question : How to make WPF button background color silver?

Dear All,

I'd like to make the backgroud color of my button to be silver, just like the button material is "metal". And it doesn't need to keep shining.

P.S. Simply set in style "<Setter Property="Background" Value="Silver">" cannot give that effect.


Thanks heaps!

Answer : How to make WPF button background color silver?

Silver is just a solid color.

In order to give it a shine, you need to use a LinearGradientBrush in the Button's template which will provide a gradient color to the button.

Here are some links which will provide you with sample templates

http://blogs.msdn.com/b/mgrayson/archive/2007/02/16/creating-a-glass-button-the-complete-tutorial.aspx
http://learnwpf.com/Posts/Post.aspx?postId=ef73ce54-ca51-4719-91b5-1ed7a4ebeca2
http://www.smartchitecture.com/blog/post/A-Simple-Glossy-Button-with-WPF.aspx
Random Solutions  
 
programming4us programming4us