Search In Site

25 June, 2013

Handling MDI Form And MDI Child Menus

Handling MDI Form And MDI Child Menus
You’ve created your new program, the super Wizard Text Editor, and made it an MDI program. But now there’s a call from the Testing Department users are getting confused. Why is the Edit menu still visible when no documents are open to edit? Can you fix this? Yes you can. Visual Basic lets you specify two menus in an MDI program, one for the MDI form and one for the MDI child form (and more if you have several types of MDI child forms). If the MDI form has a menu and the MDI child form has no menu, the MDI form’s menu is active at all times. If, on the other hand, the MDI child form has a menu, that menu takes over the MDI form’s menu system any time one or more of those child forms is open.

What this means in practice is that you give the MDI form a rudimentary menu system (typically just File and Help menus) and save the full menu system (like File, Edit, View, Insert, Format, Tools, Window, Help, and so on) for the child windows to ensure the full menu system is on display only when documents are open and those menus apply.

For example, you might add just this simple menu system to the MDI form in an MDI program.

Note that you should, at a minimum, give the user some way to open a new or existing document, and you should provide access to Help:

File
....New
....Open
Help
....Contents


Here’s an example of a full menu system you might then give to the MDI child form, which will take over the main MDI form’s menu system when a child form is open:

File
....New
....Open
....Save
....Save As
Edit
....Cut
....Copy
....Paste
Tools
....Graphics Editor
....Charts Editor
....Exporter
Help
....Contents

becomes active again it’s only when MDI child forms are open that their menus take over the main menu system.

0 comments:

Post a Comment

Dear Visitors All The Tricks And Hacks Posted Here Are Only For Knowledge Purpose.Don't Use These for Illegal Operations.

 
Twitter Bird Gadget