-
March 7th, 2004, 08:43 PM
#1
How to subclass CButton class for Checkbox?
Hi Friends,
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:
Code:
m_chk.SubclassDlgItem(IDC_CHK1, this);
DWORD style = m_chk.GetStyle();
style |= BS_OWNERDRAW;
::SetWindowLong(m_chk, GWL_STYLE, style);
I placed this in OnInitDlg.
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.
Thanks.
Jiac
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|