Monday, February 6, 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 

I have found this proper way to set the color of CDialog in MFC application. Write this Function in your class. HBRUSH CCaptureOPtionsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { if( nCtlColor == 6 ) // for Slider control { pDC->SetBkMode(TRANSPARENT);// Set the Background Mode to TRANSPARENT } else if( nCtlColor == CTLCOLOR_DLG ) // for [...]