Link to home
Start Free TrialLog in
Avatar of staffiidba
staffiidba

asked on

MDI / Child Menus

Is it possible to create a menu that exists on the Child form, which does not automatically get transferred to the MDI form when the Child form loads. I have an application that needs the MDI Menus to remain intact whilst I load multiple  
children forms who have their own menus. ???
I am stumped ???
Avatar of tward
tward

I don't believe there is a way, this is straight from the VB Help:

A Menu control displays a custom menu for your application. A menu can include commands, submenus, and separator bars. Each menu you create can have up to four levels of submenus.

Syntax

Menu

Remarks

To create a Menu control, use the Menu Editor. Enter the name of the Menu control in the Caption box. To create a separator bar, enter a single hyphen (-) in the Caption box. To display a check mark to the left of a menu item, select the Checked box.

While you can set some Menu control properties using the Menu Editor, all Menu control properties are displayed in the Properties window. To display the properties of a Menu control, select the menu name in the Objects list at the top of the Properties window.

***************************************************************************
***************************************************************************
When you create an MDI application, the menu bar on the MDI child form replaces the menu bar on the MDIForm object when the child form is active.
***************************************************************************
***************************************************************************
You could probably do it with an ActiveX control that you create, but it would probably invovle a bit of work.  I not prepared to attempt this and give you code for it, but it might steer you in the right direction.
Avatar of staffiidba

ASKER

What about subclassing, and the Win32 API ??? There must be a way somewhere...
You could simply convert the MDI child forms to non-MDI child forms and fake the child behavior.  If you show the non-child form like

frmNonChild.Show vbModeless, frmMDIParent

and then subclass the child to restrict its movement to the MDIParent's client area it should act pretty close (except for the scroll bars).  But at least they would keep their own menus.
ASKER CERTIFIED SOLUTION
Avatar of yronnen
yronnen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I like people who answer with ideas. This is a great one and will work beatifully.
Thanks