Disable Menu Items
-
Hi, I was wondering if someone could help me disable a menu option. Thank you for your help.
If you're using MFC, look up EnableMenuItem in the CMenu class documentation. If you're not using MFC, just look up EnableMenuItem.
"I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it." - Jack Handey
-
If you're using MFC, look up EnableMenuItem in the CMenu class documentation. If you're not using MFC, just look up EnableMenuItem.
"I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it." - Jack Handey
-
Hi Jason, I don't have MSDN installed on this computer, I only remember off the top of my head its something like : EnableMenuItem((i think its the menuID?), Flags); Can you or someone shed some light to get this done with MFC? Thank you for your help!
Jay Hova wrote: don't have MSDN installed on this computer You can find it online at msdn.microsoft.com[^]. It is the one most valuable resource you need as a programmer. BTW - Your compiler came with a copy of MSDN.
Who is 'General Failure'? And why is he reading my harddisk?!?
-
Hi Jason, I don't have MSDN installed on this computer, I only remember off the top of my head its something like : EnableMenuItem((i think its the menuID?), Flags); Can you or someone shed some light to get this done with MFC? Thank you for your help!
BOOL EnableMenuItem( HMENU hMenu, // handle to menu UINT uIDEnableItem, // menu item to update UINT uEnable // options ); or // MFC CMenu UINT EnableMenuItem( UINT nIDEnableItem, UINT nEnable );
"I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it." - Jack Handey
-
Hi Jason, I don't have MSDN installed on this computer, I only remember off the top of my head its something like : EnableMenuItem((i think its the menuID?), Flags); Can you or someone shed some light to get this done with MFC? Thank you for your help!
I have only been programming for a month, so please be patient. right now i am using the code i found on the msdn.microsoft.com site
CMenu* mmenu = GetMenu(); CMenu* submenu = mmenu->GetSubMenu(0); submenu->EnableMenuItem(ID_FILE_NEW, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
I get the error that GetMenu doesn't take 0 parameters? Can someone tell me whats wrong. I used similar code if not the same, to get a couple other menu options checked/unchecked and it worked fine. Don't understand why it doesn't work. Oh yeah, I have no idea why msdn is not installed on this computer? its not my own. -
I have only been programming for a month, so please be patient. right now i am using the code i found on the msdn.microsoft.com site
CMenu* mmenu = GetMenu(); CMenu* submenu = mmenu->GetSubMenu(0); submenu->EnableMenuItem(ID_FILE_NEW, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
I get the error that GetMenu doesn't take 0 parameters? Can someone tell me whats wrong. I used similar code if not the same, to get a couple other menu options checked/unchecked and it worked fine. Don't understand why it doesn't work. Oh yeah, I have no idea why msdn is not installed on this computer? its not my own.You are mixing CWnd::GetMenu/CWindow::GetMenu and ::GetMenu Win API: HMENU GetMenu( HWND hWnd ); From your mainframe class try calling GetMenu()... Brian
-
You are mixing CWnd::GetMenu/CWindow::GetMenu and ::GetMenu Win API: HMENU GetMenu( HWND hWnd ); From your mainframe class try calling GetMenu()... Brian