I use VC++6 and it's dialog editor to graphically create dilaogs.
How can I change the background color of all my buttons (about 100) from default grey to black and the font-color to white?
thx
Printable View
I use VC++6 and it's dialog editor to graphically create dilaogs.
How can I change the background color of all my buttons (about 100) from default grey to black and the font-color to white?
thx
Probably the easiest way would be to do it in the code if the ID's for your buttons are consecutive because then you would just have to create the brush object and the font object and use a for loop.
'CButton' is the only control that does not respond to the 'OnCtlColor()' message handler even though the MSDN (http://msdn.microsoft.com) explains it that way. To change the color of a 'CButton' control you have to set the style to ownerdrawn and do it yourself.
You will find a complete 'CColorButton' class at http://www.codeguru.com/buttonctrl/color_button.shtml. This class does not allow you to change the color at run-time...you will find a modified control at http://www.codeguru.com/buttonctrl/ClrButton.html