Solved

MDI / Child Menus

Posted on 1998-07-28
6
326 Views
Last Modified: 2011-09-20
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
Comment
Question by:staffiidba
6 Comments
 
LVL 7

Expert Comment

by:tward
ID: 1466941
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
 
LVL 2

Expert Comment

by:Jagar
ID: 1466942
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
 

Author Comment

by:staffiidba
ID: 1466943
What about subclassing, and the Win32 API ??? There must be a way somewhere...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:Grant082997
ID: 1466944
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
 
LVL 5

Accepted Solution

by:
yronnen earned 120 total points
ID: 1466945
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
 

Author Comment

by:staffiidba
ID: 1466946
I like people who answer with ideas. This is a great one and will work beatifully.
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question