// TODO: Change any attributes of the DC here if (IDC_TXT == ::GetWindowLong( pWnd->GetSafeHwnd(), GWL_ID) ) { pDC->SetBkColor(RGB(0,0,255)); pDC->SetTextColor(RGB(255,255,225)); } // TODO: Return a different brush if the default is not desired return hbr; }
这个类你在网上也可以找到,直接设置RGB就可以了,大小、字体都可以设置
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if (IDC_TXT == ::GetWindowLong( pWnd->GetSafeHwnd(), GWL_ID) )
{
pDC->SetBkColor(RGB(0,0,255));
pDC->SetTextColor(RGB(255,255,225));
}
// TODO: Return a different brush if the default is not desired
return hbr;
}