Click here to Skip to main content
15,887,961 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

I have created a MFC-MDI app, I want to change menubar on a menu click event. can anyone help me in it.

Thanks in advance.
Posted

1 solution

In general to change the menubar of a window there is the SetMenu function.
(and all the Menu management functions you can find in the CMenu documentation).

But on MDI apps you must be careful about it: the main window menu is -normally- automatically replaced by the MDI active child menu, that is in turn modified adding entries in the second-last (normally named "Window") menu to reflect the actual MDI frame composition.

In other words, MDI defines itself how menus should be managed. Managing them differently violates the paradigm, and may confuse the users (that find a "well known" interface behaving not in the way they expect).

Note that this is not even an MFC issue: there are win32 API (and special default procedures - almost an oxymoron) for MDI parent, client and children.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Jan-11 10:03am    
I agree - my 5.
If you also recommend never using MDI, will be just right.
See also http://www.codeproject.com/Answers/151276/GUI-Apperance-Csharp-Net.aspx
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900