CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    26

    Enabling Menu Item in Main Menu?

    I am trying to enable a menu item in the main menu bar.
    I have a created a handler for the menu item in CMainFrame and have tried to call pMenu->EnableMenuItem(itemID, MF_BYCOMMAND|MF_GRAYED); and this doesn't seem to work.
    However, calling pMenu->CheckMenuItem(itemID, MF_BYCOMMAND, MF_CHECKED) will put a checkmark next to the menu item.
    I know this is a simple problem, please enlighten me with a possible solution?
    Thanks,
    Roberto


  2. #2
    Guest

    Re: Enabling Menu Item in Main Menu?

    Hi Roberto:

    You should add ON_UPDATE_UI commands for your menus. There you can enable or disable menu items.
    You should also put your CheckMenuItem logic in that same handler. Do a search in your Online Documentation for CCmdUI.

    Regards,

    Francisco J. Novas


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured