16,472
社区成员
发帖
与我相关
我的任务
分享
你的代码貌似没有问题。。。
BOOL CXXXDlg::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CRect rc;
GetClientRect(rc);
pDC->FillSolidRect(rc, RGB(255, 0, 128));
return TRUE;
//return CDialog::OnEraseBkgnd(pDC);
}
HBRUSH CXXXDlg::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_STATIC1)
{
pDC->SetTextColor(RGB(0,0,250));
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
// TODO: Return a different brush if the default is not desired
return hbr;
}