Windows Develop Bookmark and Share   
 index > Windows Forms General > How to Change WinForms Buttons BackColor ?
 

How to Change WinForms Buttons BackColor ?

Hi,

I'm using VS2008 and VB to develop an application for XP, I would like to know if there's a way to change the color of a standard button (FlatStyle=Standard and BackColor=Transparent), I mean, the buttons have a silver style color as default, If I change the BackColor to another color it just doesn't look right, borders are white and center has a flat style.

Is there any way to change the BackColor in a smooth, clear and uniform way ?

Thanks in advance.

George Waters  Saturday, October 03, 2009 8:33 AM
There's no good fix for this, you can't override the button renderer that's used.  You can blast over whatever the base class painted in your own Paint event but that's a lot of work to get right.  You get no help from the renderer used by the Standard style, ButtonStandardAdapter, it is internal.  Poke around with Reflector to see what you'd need to do.

Hans Passant.
nobugz  Saturday, October 03, 2009 3:29 PM
There's no good fix for this, you can't override the button renderer that's used.  You can blast over whatever the base class painted in your own Paint event but that's a lot of work to get right.  You get no help from the renderer used by the Standard style, ButtonStandardAdapter, it is internal.  Poke around with Reflector to see what you'd need to do.

Hans Passant.
nobugz  Saturday, October 03, 2009 3:29 PM
Thanks Hans
George Waters  Saturday, October 03, 2009 9:32 PM

You can use google to search for other answers

Custom Search

More Threads

• Creating XML documents in C#
• DLL Reference Flip-Flop
• DataGrid Column Header Cuts off when right aligning it
• Issue with ToolStripMenuItem in WindowsForms
• How can I set ListBox.HorizontalExtent to the good value.
• Questions regarding combobox in Windows form
• Gridview Autocomplete Related Stuff
• Access Form2 from Form1
• Guys S.O.Need your help:: WebBrowser -> Navigate to a local { resource < that he's an Html page > }
• How to access app.config's settings from user control