请问,怎么才能改变对话框的背景色呢?是所有的RGB色都可以显示的吧!

解决方案 »

  1.   

    是啊,重写WM_ERASEBKGND消息的处理函数,在其中设置
      

  2.   

    是用CWinApp::SetDialogBkColor()函数吗?
      

  3.   

    TO  VCPP_Hunter:
    用SetDialogBkColor会对你的应用程序的所有对话框起作用.而处理OnCtlColor或OnEraseBkGround只会对单个对话框起作用
      

  4.   

    那这个和onerasebkground有什么区别吗?
      

  5.   

    OnEraseBkGround:
    The framework calls this member function when the CWnd object background needs erasing (for example, when resized). It is called to prepare an invalidated region for painting.//invalidate时改变控件颜色
    OnCtlColor:
    The framework calls this member function when a child control is about to be drawn. Most controls send this message to their parent (usually a dialog box) to prepare the pDC for drawing the control using the correct colors.
      

  6.   

    OnCtlColor是可以改变单个控件的是吧!从那个英文里看好像是的!