Tuesday, May 22, 2012

How to set border of CDialog

November 3, 2009 by · Leave a Comment 

I am new in MFC. I put some time to draw a border around a Dialog in MFC application. Here is the solution that i found. It is very simple for any level of programmer. Follow just three simple steps. Step1: Add OnCtlColor() method in your Message map like:- BEGIN_MESSAGE_MAP(CDATToSWFDlg, CTrayDialog) ON_WM_CTLCOLOR() END_MESSAGE_MAP() Step2: Add [...]

Changing the background color of a dialog

November 1, 2009 by · Leave a Comment 

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{…protected: CBrush m_brush;…}; Then, add this line in the OnInitDialog function: BOOL CTestDlg::OnInitDialog(){ … m_brush.CreateSolidBrush(RGB(255, 255, 255)); // color white brush … } [...]