March 7th, 2004, 08:43 PM
How to subclass CButton class for Checkbox?
I need to subclass a checkbox, and that is of CButton class. I tried that, and overwrite OnPaint(), however the check box disappears, I guess that is because I would need to paint the checkbox as well, well, that is beyond my knowledge, so I tried to overwrite OnCtlColor, however that doesn't get called.
One post said that I would need to set the ownerdraw flag, I tried that it doesn't work with the following:
I placed this in OnInitDlg.
DWORD style = m_chk.GetStyle();
style |= BS_OWNERDRAW;
::SetWindowLong(m_chk, GWL_STYLE, style);
Please help, am I understanding this correctly and how to fix this.
Basically I need to change the font size/color of the checkbox text but still retain the checkbox bitmap itself since I don't know how to drawt that.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!