Tuesday, May 22, 2012

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 [...]