Solved

MDI / Child Menus

Posted on 1998-07-28
6
323 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

932 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

10 Experts available now in Live!

Get 1:1 Help Now