How to enable/disable menu items in a dialog-based app?
-
Hello people, i am working on a dialog-based mfc app. I added a member-variable of type CMenu to the CDialog-derived class, so that a menu is available. I use the ON_UPDATE_COMMAND_UI makro in the message-map of the Dialog to enable/disable menu-items. But the corresponding menu-item isn't drawn in grey color as expected when it is disabled. Why? Does someone has a clue how i can fix this? Best regards tabor25
-
Hello people, i am working on a dialog-based mfc app. I added a member-variable of type CMenu to the CDialog-derived class, so that a menu is available. I use the ON_UPDATE_COMMAND_UI makro in the message-map of the Dialog to enable/disable menu-items. But the corresponding menu-item isn't drawn in grey color as expected when it is disabled. Why? Does someone has a clue how i can fix this? Best regards tabor25
Check Bernd Giesen's article Applying an update UI notification interface to user-defined controls[^]. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
Check Bernd Giesen's article Applying an update UI notification interface to user-defined controls[^]. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
Thank you very much for answering to my question. I read the recommended article and added a menu to the demo-project including a test-item. Then i added a UI notification-handler for the menu-item to the dialog-class (where the ui-handler for the button is located), but in case of disabled the menu-item would not be drawn in grey color. I don't know what to do! Best regards tabor25