改变对话框的背景色应该怎么办?
void CPowDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CRect rc;
this->GetWindowRect(rc);
int l,t,b,r;
l=rc.left;
r=rc.right;
t=rc.top;
b=rc.Height()/4+t;
CRect rc1(l,t,r,b);
dc.FillSolidRect(rc1,RGB(255,255,0));
b=rc.Height()/4*3+t;
t=b=rc.Height()/4+t;
CRect rc2(l,t,r,b);
dc.FillSolidRect(rc2,RGB(255,255,0));
// Do not call CDialog::OnPaint() for painting messages
}
以上是我在对话框的OnPaini函数中写的代码,是想改变对话框的上面四分之一跟下面的四分之一的颜色,但是运行之后没有作用,问哈我该怎么写代码才可以???????????