在view中响应onctlcolor消息...
HBRUSH CmyView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
hbr=CreateSolidBrush(RGB(255,0,0));
return hbr;
}
如果你的对话框上有其它控件...而且你不想让对话框之外的控件背景色改变的话...你必须对pWnd进行判断...然后返回相应的画刷...
HBRUSH CmyView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
hbr=CreateSolidBrush(RGB(255,0,0));
return hbr;
}
如果你的对话框上有其它控件...而且你不想让对话框之外的控件背景色改变的话...你必须对pWnd进行判断...然后返回相应的画刷...