CColorButton

CColorButton - A colored button control.
Although I like to prevent using non-standard colors for controls and text in my applications, for one project I needed buttons were I could specify another color for the button face. Unfortunately this isn’t possible with the standard MFC buttons, so I used the owner drawn technique to create this simple CButton subclass.
I tried to make it look and feel the same as the standard button, so text aligning and disabled mode are implemented exactly the same as the original Windows button.
The class has only two (obvious) methods:

void SetBkColor(COLORREF clrBackground);

and

void SetTextColor(COLORREF clrText);

Check out the example to see the class is use.


Download example executable

Download source code
This class is part of the Pablo Software Solutions MFC Extension Package - Controls Edition
 

[Home] [Products] [Source Code] [Downloads] [Support]

© 2015 - Pablo Software Solutions
All rights reserved.