VC中怎么设置子对话框的背景色?
2个回答
展开全部
1、添加子对话框的WM_paint消息 代码如下
void CMyQueryDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CRect rect;
GetClientRect(&rect);
CBrush b(RGB(255,0,0));
dc.FillRect(rect,&b);
// Do not call CDialog::OnPaint() for painting messages
}
void CMyQueryDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CRect rect;
GetClientRect(&rect);
CBrush b(RGB(255,0,0));
dc.FillRect(rect,&b);
// Do not call CDialog::OnPaint() for painting messages
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询