how to disable/enable menu items
-
I want to disable and enable menu items depending on conditions. Say for eg. if menu is File Input Analysis Help There are many items under each menu. If 1st item under File is clicked, Input menu has to be enabled.
-
I want to disable and enable menu items depending on conditions. Say for eg. if menu is File Input Analysis Help There are many items under each menu. If 1st item under File is clicked, Input menu has to be enabled.
There's two messages attached to a menu item. One is a click event, the other is a callback, which is called just before it is shown, you set those things there.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
I want to disable and enable menu items depending on conditions. Say for eg. if menu is File Input Analysis Help There are many items under each menu. If 1st item under File is clicked, Input menu has to be enabled.
This is the best way:
BEGIN_MESSAGE_MAP(CYourFrame, CMainFrame) ON_UPDATE_COMMAND_UI(ID_MENU_ITEM_1, OnUpdateMenuItem1) END_MESSAGE_MAP() //******************************************************************************************* void CYourFrame::OnUpdateMenuItem1(CCmdUI *pCmdUI) { pCmdUI->Enable([TRUE or FALSE here depending on condition]); }
Hope it helps