HBRUSH CGgDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);// TODO: Change any attributes of the DC here if((pWnd->GetDlgCtrlID()==IDC_CHECK1/*换成你的复选框的ID*/)) { pDC->SetBkMode(TRANSPARENT); return HBRUSH(GetStockObject(HOLLOW_BRUSH)); } // TODO: Return a different brush if the default is not desired // TODO: Return a different brush if the default is not desired return hbr; }
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);// TODO: Change any attributes of the DC here
if((pWnd->GetDlgCtrlID()==IDC_CHECK1/*换成你的复选框的ID*/))
{
pDC->SetBkMode(TRANSPARENT);
return HBRUSH(GetStockObject(HOLLOW_BRUSH));
}
// TODO: Return a different brush if the default is not desired
// TODO: Return a different brush if the default is not desired
return hbr;
}