Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable menu items?

Status
Not open for further replies.

Naits

Programmer
Joined
Oct 10, 2001
Messages
90
Location
NO
How to disable meny items? __________________
Visit my homepage
.: Game universE :.
 
from MFC classwizard find your menu id, create a UNDATE_COMMAND_UI message handler. inside the handler write:
pCmdUI->Enable(FALSE);
 
In your MainFrm.cpp class, try this:

CMenu* pMenu = GetMenu();
m_bAutoMenuEnable=FALSE;

CMenu* subMenu = pMenu->GetSubMenu(2); //3rd menu item
// disable 1st submenu item of the 3rd menu item
subMenu->EnableMenuItem(0, MF_GRAYED | MF_BYPOSITION);
// enable 1st submenu item of the 3rd menu item
subMenu->EnableMenuItem(0, MF_ENABLED | MF_BYPOSITION);
DrawMenuBar();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top