MFC对话框显示时背景闪烁
1 HBRUSH CZGDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 2 { 3 HBRUSH hbr = __super::OnCtlColor(pDC, pWnd, nCtlColor); 4 if (nCtlColor == CTLCOLOR_DLG) 5 { 6 COLORREF tcolor = RGB(39, 147, 255); 7 hbr = CreateSolidBrush(tcolor); 8 } 9 return hbr; 10 }
效果如下: