if (nCtlColor==CTLCOLOR_STATIC || nCtlColor==CTLCOLOR_EDIT) { pDC->SetBkMode(TRANSPARENT); return (HBRUSH)::GetStockObject(NULL_BRUSH); } if (nCtlColor==CTLCOLOR_DLG) return (HBRUSH)m_BKBrush.GetSafeHandle(); // TODO: Return a different brush if the default is not desired return hbr; }
HBRUSH CXXXX::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if (nCtlColor==CTLCOLOR_STATIC || nCtlColor==CTLCOLOR_EDIT)
{
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)::GetStockObject(NULL_BRUSH);
}
if (nCtlColor==CTLCOLOR_DLG)
return (HBRUSH)m_BKBrush.GetSafeHandle();
// TODO: Return a different brush if the default is not desired
return hbr;
}