第1个回答 2011-04-14
你可以给对话框添加一个WM_CTLCOLOR事件,代码如下:
HBRUSH CMyDlgDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr;
if(nCtlColor==CTLCOLOR_DLG){
CBrush brush(&m_crBK);
CRect rect;
GetClientRect(&rect);
pDC->SelectObject(&brush);
pDC->FillRect(&rect,&brush);
return brush;
}
else
hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
return hbr;
}
m_crBK是一个CBitmap的对象,可以用先导入张位图,然后用m_crBK.LoadBitmap(IDB_BMP_BK);//IDB_BMP_BK是资源ID
字体大小在对话框中有选项的