您的位置:首页 > 其它

设置对话框(Dialog)的背景色

2008-10-28 17:39 246 查看
重载WM_CTLCOLOR响应函数
HBRUSH CDlgTest::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
//HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

// TODO: Change any attributes of the DC here
switch (nCtlColor)
{
case CTLCOLOR_DLG:
{
CBrush* back_brush;
COLORREF color;
color = RGB(255,255,255);
back_brush = new CBrush(color);
return (HBRUSH) (back_brush->m_hObject);
}
}
return(CDialog::OnCtlColor(pDC, pWnd, nCtlColor));
// TODO: Return a different brush if the default is not desired
//return hbr;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: