• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

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 ???
0
staffiidba
Asked:
staffiidba
1 Solution
 
twardCommented:
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.
***************************************************************************
***************************************************************************
0
 
JagarCommented:
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.
0
 
staffiidbaAuthor Commented:
What about subclassing, and the Win32 API ??? There must be a way somewhere...
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Grant082997Commented:
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.
0
 
yronnenCommented:
You should "fake" the menu:

On you MDI form create the menus you want to see in the child forms. Make these menus invisible. For example let's say that the name of the menu is mnuChild.

On each child form that you want to have a menu, add a picture box. Make its border flat, and place labels that will be the menus. For example place a label at the left side of the picture box and set its caption to "File".

On the click event of that label add this code:
Popupmenu MDIForm.mnuChild.

This will simulate the menu.

You can do that even better if you'll use the x,y values of the popupmenu function and place the menu exactly below the label. The user will not notice the difference.

0
 
staffiidbaAuthor Commented:
I like people who answer with ideas. This is a great one and will work beatifully.
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now