标签:style blog http color os strong io 2014
菜单单选
关键点
CMenu::GetMenuState
UINT GetMenuState( UINT nID, UINT nFlags ) const;
MF_CHECKED
MF_DISABLED
MF_ENABLED
MF_GRAYED
MF_MENUBARBREAK
MF_MENUBREAK
MF_SEPARATOR
MF_UNCHECKED
nFlags
MF_BYCOMMAND
MF_BYPOSITION
CMenu::CheckMenuItem
UINT CheckMenuItem( UINT nIDCheckItem, UINT nCheck );
实现过程
CMenu *pMenu = GetMenu();
CMenu *pSubMenu=pMenu->GetSubMenu(3);
if( pSubMenu->GetMenuState(ID_VIEW_STATUS_BAR,MF_BYCOMMAND)==MF_CHECKED)
{
pSubMenu->CheckMenuItem(ID_VIEW_STATUS_BAR,MF_UNCHECKED);
}
else
{
pSubMenu->CheckMenuItem(ID_VIEW_STATUS_BAR,MF_CHECKED); } |
图
备注
单击1次选中√
再次单击取消选中
相关链接
C++ CheckMenuItem,布布扣,bubuko.com
标签:style blog http color os strong io 2014
原文地址:http://www.cnblogs.com/xe2011/p/3885709.html