按钮的更新不需要其他的东西,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.
GetDlgItem(ID_BUTTON)->EnableWindow(TRUE or FALSE);
Invalidate()更新界面
UpdateData更新数据不过
我还是没有明白你的意思
怎么实现,据我所知,按钮控件没有UPDATE_COMMAND_UI机制
getdlgitem(ID_button)->showwindow(true);ID_button按钮ID
要更新标题可以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.
如果想实现其它的效果,从CButton类派生吧!
getdlgitem(ID_button)->showwindow(true);==========================
显示与不显示
GetDlgItem(IDC_BUTTON1)->EnableWindow(false);
变灰不能用
......(true);
可以用