展开全部
在头文件里定义一个CBrush brush;
在该窗口初始化时:
brush.CreateSolidBrush(RGB(255,0,0));
再重载:
HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(pWnd-> m_hWnd == m_static.m_hWnd )
{
pDC-> SetBkColor(RGB(255,0,0));
return (HBRUSH)brush;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
在该窗口初始化时:
brush.CreateSolidBrush(RGB(255,0,0));
再重载:
HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(pWnd-> m_hWnd == m_static.m_hWnd )
{
pDC-> SetBkColor(RGB(255,0,0));
return (HBRUSH)brush;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询