记得好象是在OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)中改变画刷,但是搞不定,不知怎么回事,特求救,有什么需要注意的东西??
谢谢各位高手指教

解决方案 »

  1.   

    HBRUSH C****Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
    {
    HBRUSH hbr = CreateSolidBrush(RGB(255,255,200));
             return hbr;
    }
    不过用这个如果你的对话框上没有什么动态显示的东西还可以,如果有时间刷新之类
    的东东,劝你还是用图片作背景好了,否则要花屏的!
      

  2.   

    HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
       {
           switch (nCtlColor) {       case CTLCOLOR_STATIC:
               // Set the static text to white on blue.
               pDC->SetTextColor(RGB(255, 255, 255));
               pDC->SetBkColor(RGB(0, 0, 255));
               // Drop through to return the background brush.       case CTLCOLOR_DLG:
               return (HBRUSH)(m_pBkBrush.GetSafeHandle());       default:
                return CFileDialog::OnCtlColor(pDC, pWnd, nCtlColor);
           }
       }
      

  3.   

    TO:gdh(凌霄)
    我最近做了一个图片背景的俄罗斯方块~
    什么双缓冲,内存DC
    搞得我头发都快白了
      

  4.   

    CWinApp::SetDialogBkColor 
    void SetDialogBkColor( COLORREF clrCtlBk = RGB(192, 192, 192), COLORREF clrCtlText = RGB(0, 0, 0) );ParametersclrCtlBkThe dialog background color for the application.clrCtlTextThe dialog control color for the application.ResCall this member function from within the InitInstance member function to set the default background and text color for dialog boxes and message boxes within your application.ExampleBOOL CMyApp::InitInstance()
    {
       // Standard initialization   SetDialogBkColor();        // Set dialog background color to gray
       LoadStdProfileSettings();  // Load standard INI file options (including MRU)   // ...
    }