VC中怎么设置子对话框的背景色?

2024-12-19 15:30:01
推荐回答(2个)
回答1:

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
}

回答2:

可以设定的