试了用Invalidate()函数,可是不行

解决方案 »

  1.   

    UpdateWindow试试
    Invalidate()更新界面
    UpdateData更新数据不过
    我还是没有明白你的意思
      

  2.   

    给对话框添加UPDATE_COMMAND_UI机制的支持
      

  3.   

    哦,你使用ShowWindow()就可以搞定了。
      

  4.   

    给对话框添加UPDATE_COMMAND_UI机制的支持??
    怎么实现,据我所知,按钮控件没有UPDATE_COMMAND_UI机制
      

  5.   

    canoe_eyes(阿里) 的方法 就可以吧
      

  6.   

    getdlgitem(ID_button)->showwindow(false);
    getdlgitem(ID_button)->showwindow(true);ID_button按钮ID
      

  7.   

    按钮的更新不需要其他的东西,CButton控制类就可以完成。
    要更新标题可以GetDlgItem(ID_Button)->SetWindowsText(_T("标题"));
    下面上一些成员函数:
    ConstructionCButton Constructs a CButton object. 
    InitializationCreate //Creates the Windows button control and attaches it to the CButton object. 
    OperationsGetState //Retrieves the check state, highlight state, and focus state of a button control. 
    SetState// Sets the highlighting state of a button control. 
    GetCheck //Retrieves the check state of a button control. 
    SetCheck //Sets the check state of a button control. 
    GetButtonStyle //Retrieves information about the button control style. 
    SetButtonStyle //Changes the style of a button. 
    GetIcon //Retrieves the handle of the icon previously set with SetIcon. 
    SetIcon //Specifies an icon to be displayed on the button. 
    GetBitmap //Retrieves the handle of the bitmap previously set with SetBitmap. 
    SetBitmap //Specifies a bitmap to be displayed on the button. 
    GetCursor //Retrieves the handle of the cursor image previously set with SetCursor. 
    SetCursor //Specifies a cursor image to be displayed on the button. 
      

  8.   

    GetDlgItem(ID_BUTTON)->EnableWindow(TRUE or FALSE);
      

  9.   

    如果只是更新按钮的状态用(小虫虫)的方法就OK了!
    如果想实现其它的效果,从CButton类派生吧!
      

  10.   

    getdlgitem(ID_button)->showwindow(false);
    getdlgitem(ID_button)->showwindow(true);==========================
    显示与不显示
    GetDlgItem(IDC_BUTTON1)->EnableWindow(false);
    变灰不能用
    ......(true);
    可以用