If you want to change the background color of your dialog box, it is a very simple.
In your CTestDlg header file, declare a member variable from CBrush:
class CTestDlg : public CDialog
Then, add this line in the OnInitDialog function:
m_brush.CreateSolidBrush(RGB(255, 255, 255)); // color white brush
Finally do this on the ID_CTLCOLOR handle:
HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
** No need to do this!
** HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
** Return the white brush.
Hope this could help any fellow programmer!
Date Last Updated: February 8, 1999