1 Attachment(s)
Is there any straightforward way to change the background color of a check box?
Attachment 35647
I'm trying to change the white rectangle that makes up the background of the checkbox to gray like the surrounding color. However it seems that there is no easy way to do this. Is this even possible? I was told to try overriding #OnCtlColor# but I haven't been able to get that to work. My understanding of all things Windows and MFC is definitely lacking so my attempt could simply be wrong. I'm leaving for a moment soon but when I come back I can post the code of my attempt if that helps. Other than that, does anyone have any ideas / pointers to lead me in the right direction? Thanks.
Re: Is there any straightforward way to change the background color of a check box?
Re: Is there any straightforward way to change the background color of a check box?
Code:
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->GetDlgCtrlID() == IDC_MYBUTTON)
pDC->SetBkColor(RGB(255, 255, 255));
return hbr;
}