Solved

MDI / Child Menus

Posted on 1998-07-28
6
322 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
Comment Utility
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
Comment Utility
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
Comment Utility
What about subclassing, and the Win32 API ??? There must be a way somewhere...
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Expert Comment

by:Grant082997
Comment Utility
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
Comment Utility
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
Comment Utility
I like people who answer with ideas. This is a great one and will work beatifully.
Thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now