作者:shirliyap | 来源:互联网 | 2023-08-22 14:30
ThismemberfunctionoperateslikeSetCheck,exceptthatitoperatesonuser-interfaceitemsacting
This member function operates like SetCheck, except that it operates on user-interface items acting as part of a radio group. Unchecking the other items in the group is not automatic unless the items themselves maintain the radio-group behavior.
怎么能把菜单项设成一组呢?
8 个解决方案
这个成员函数的作用类似与SetCheck,可惜它针对用户接口项的操作只相当于radio group的一部分。在一组中取消别的项目的选择不是自动的,除非项目之间自己维护着radio-group 行为。
什么叫
它针对用户接口项的操作只相当于radio group的一部分
menu item有group属性??
The following table summarizes the effect CCmdUI's member functions have on various command user-interface items.
User-Interface Item Enable SetCheck SetRadio SetText
Menu item Enables or disables Checks (×) or unchecks Checks using dot (•) Sets item text
Toolbar button Enables or disables Selects, unselects, or indeterminate Same as SetCheck (Not applicable)
Status-bar pane Makes text visible or invisible Sets pop-out or normal border Same as SetCheck Sets pane text
Normal button in CDialogBar Enables or disables Checks or unchecks check box Same as SetCheck Sets button text
Normal control in CDialogBar Enables or disables (Not applicable) (Not applicable) Sets window text
For more on the use of this class, see How to Update User-Interface Objects.
翻译:
只有Radio控件设置了Group属性, SetRadio()方法才会取消同Group其它Radio控件的选中状态. 否则用法同CheckBox控件的SetCheck()方法.
这个函数不是菜单项的函数吗?菜单项有group属性??
void CMainFrame::OnUpdateMenuitem2(CCmdUI* pCmdUI)
{
pCmdUI->SetRadio();
pCmdUI->m_pMenu->CheckMenuRadioItem(0, 2, 2, MF_BYPOSITION);
}