Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to enable/disable menu items in a dialog-based app?

How to enable/disable menu items in a dialog-based app?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tabor25
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • T 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

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      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

      T 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        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

        T Offline
        T Offline
        tabor25
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups