Click to See Complete Forum and Search --> : Disabling the Menu Bar


LynnMaras
July 19th, 1999, 06:40 AM
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.

Fabi Pantera
July 19th, 1999, 06:50 AM
CMenu* pSecond = pMenu->GetSubMenu(1);
pSecond->EnableMenuItem(1, MF_BYPOSITION|MF_GRAYED);
let menkow if this helps you.
Best regards,
Faby

LynnMaras
July 19th, 1999, 06:57 AM
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.

Fabi Pantera
July 19th, 1999, 07:08 AM
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

LynnMaras
July 19th, 1999, 07:22 AM
Thank you very much, yes this works just how I wanted to :)

LynnMaras
July 19th, 1999, 07:26 AM
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...

Fabi Pantera
July 19th, 1999, 07:37 AM
Try to send a message to this item (a WM_COMMAND).
It works?
Same Faby Pantera

LynnMaras
July 19th, 1999, 07:50 AM
Yes, thank you once again. You have been a big help.