热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CCmdUI::SetRadio()和SetCheck有什么区别呀?看不懂MSDN说的。

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 个解决方案

#1


这个成员函数的作用类似与SetCheck,可惜它针对用户接口项的操作只相当于radio group的一部分。在一组中取消别的项目的选择不是自动的,除非项目之间自己维护着radio-group 行为。

#2


只是翻译了一下,这个函数没有用过呀~

#3


什么叫

它针对用户接口项的操作只相当于radio group的一部分

menu item有group属性??

#4


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.

#5


之所以是一部分,可能就是不互斥吧,我的理解

#6


翻译:
只有Radio控件设置了Group属性, SetRadio()方法才会取消同Group其它Radio控件的选中状态. 否则用法同CheckBox控件的SetCheck()方法.

#7


这个函数不是菜单项的函数吗?菜单项有group属性??

#8


void CMainFrame::OnUpdateMenuitem2(CCmdUI* pCmdUI) 
{
pCmdUI->SetRadio();
pCmdUI->m_pMenu->CheckMenuRadioItem(0, 2, 2, MF_BYPOSITION);
}

推荐阅读
author-avatar
shirliyap
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有