Change color of controls.
Posted on 2000-03-06
I have a splitter window with 2 formviews. On the left pane I have changed the color of the entire form using the following code in OnPaint:
GetClientRect( rect );
dc.FillSolidRect( rect, RGB( 128, 128, 128 ) );
That code works just fine. But now I want to place a button on that form, and I want the button to have the same color as the background. How can I do that? I have tried to use the following code in the OnCtlColor handler:
brush.CreateSolidBrush (RGB( 128, 128, 128 ));
if ( nCtlColor == CTLCOLOR_BTN )
It doesn't work, what's wrong?
I also have a static ctrl on the right pane which I want to change the color in, I need to know how to do that aswell.