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

    Disabling the Menu Bar

    Hi, does anyone know how to disable the entire menu bar( File, Edit, View...etc) ? Each menu doesn't have a ID, so I wasn't sure how to do this. I know how to do each of the contents of the menus, but I just thought it would be easier to grey out the entire thing, rather than each one separately. Thanks.


  2. #2
    Join Date
    Jun 1999
    Posts
    319

    Re: Disabling the Menu Bar

    CMenu* pSecond = pMenu->GetSubMenu(1);
    pSecond->EnableMenuItem(1, MF_BYPOSITION|MF_GRAYED);
    let menkow if this helps you.
    Best regards,
    Faby


  3. #3
    Join Date
    Jul 1999
    Posts
    20

    Re: Disabling the Menu Bar

    What is pMenu a member of? Cause the way I am trying to do this, is when the user clicks on a certain menu option under View, I want to grey out each of the other menu options, and then re-enable them when the user clicks it again.


  4. #4
    Join Date
    Jun 1999
    Posts
    319

    Re: Disabling the Menu Bar

    It should be like this one:
    CMenu* pMenu = AfxGetMainWnd()->GetMenu();
    pMenu->EnableMenuItem(....
    Add this code when you want to grayed it.
    It works?
    Regards,
    Faby


  5. #5
    Join Date
    Jul 1999
    Posts
    20

    Re: Disabling the Menu Bar

    Thank you very much, yes this works just how I wanted to


  6. #6
    Join Date
    Jul 1999
    Posts
    20

    One other thing....

    Is there a way to get this to update right away? UpdataWnd or something... because it only grays out when the mouse is moved over it...


  7. #7
    Join Date
    Jun 1999
    Posts
    319

    Re: One other thing....

    Try to send a message to this item (a WM_COMMAND).
    It works?
    Same Faby Pantera


  8. #8
    Join Date
    Jul 1999
    Posts
    20

    Re: One other thing....

    Yes, thank you once again. You have been a big help.


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