HBRUSH CTestDlg1Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
// 判断下是不是你要改的控件ID
if( pWnd->GetDlgCtrlID() == IDC_STATIC_MAX )
{
pDC->SetTextColor(RGB(255,0,0)); //字体颜色
pDC->SetBkColor(RGB(0, 0, 255)); //字体背景色
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
重绘空间,响应WM_ERASEBKGND,根据颜色绘制控件的背景
控件属性设置里面没又吗??