菜单恢复(我灰化了菜单后怎么恢复呀?)
CMenu * pMenu=this->GetMenu();
pMenu->EnableMenuItem(IDC_KH,MF_BYCOMMAND| MF_DISABLED | MF_GRAYED);
我将菜单灰化后怎么恢复呀?谢谢高手!
问题点数:40、回复次数:4Top
1 楼xiao_xiao_zi(笑小子)回复于 2005-05-16 17:48:11 得分 10
pMenu->EnableMenuItem(IDC_KH,MF_BYCOMMAND| MF_ENABLED);Top
2 楼cnwolf(独狼)回复于 2005-05-16 17:57:04 得分 15
查看msdn
CMenu::EnableMenuItem
UINT EnableMenuItem( UINT nIDEnableItem, UINT nEnable );
Return Value
Previous state (MF_DISABLED, MF_ENABLED, or MF_GRAYED) or –1 if not valid.
Parameters
nIDEnableItem
Specifies the menu item to be enabled, as determined by nEnable. This parameter can specify pop-up menu items as well as standard menu items.
nEnable
Specifies the action to take. It can be a combination of MF_DISABLED, MF_ENABLED, or MF_GRAYED, with MF_BYCOMMAND or MF_BYPOSITION. These values can be combined by using the bitwise OR operator. These values have the following meanings:
MF_BYCOMMAND Specifies that the parameter gives the command ID of the existing menu item. This is the default.
MF_BYPOSITION Specifies that the parameter gives the position of the existing menu item. The first item is at position 0.
MF_DISABLED Disables the menu item so that it cannot be selected but does not dim it.
MF_ENABLED Enables the menu item so that it can be selected and restores it from its dimmed state.
MF_GRAYED Disables the menu item so that it cannot be selected and dims it.
Top
3 楼oyljerry(【勇敢的心】→ ㊣提拉米苏√㊣)回复于 2005-05-16 21:27:52 得分 5
EnableMenuItem的参数改一下就可以了Top
4 楼liu_aq(qq)回复于 2005-05-16 21:46:17 得分 10
pMenu->EnableMenuItem(IDC_KH,MF_BYCOMMAND| MF_ENABLED);Top




