An array of Form types.

RegisterMdiChildTypes(Type[]) Method

Registers the MDI child form types that could be created during the course of an MDI application.
Public Overridable Sub RegisterMdiChildTypes( _
   ByVal formTypes() As Type _
Dim instance As MainFrameBarManager
Dim formTypes() As Type
public virtual void RegisterMdiChildTypes( 
   Type[] formTypes


An array of Form types.
Will be thrown if either of the types in the array is not derived from the Form class, if either of the types do not have a default constructor, if the passed in types do not have a ChildFrameBarManager associated with them or if the form associated with this MainFrameBarManager is not an MdiContainer.

Explicit MDI Merging:

Calling this method merges the menus and toolbars of the child forms with that of the main form (in an MDI scenario), immediately. The toolbars from the child forms will then be available in the "Toolbars List" for user-customization.

You should call this in either your MDI Parent Form's constructor or Load event handler.

This method is intended to support the following scenario. In an MDI app, you might want the XPMenus framework to merge the child form types's menus and toolbars that the MDI Parent will be parented to during the course of the application, even before the child forms are visible. Doing so will then present a seemless interface to the user with the toolbars and menus from all the different child form types being available for user-customization, all the time.

Also a dummy instance of the child form types will be created at this time to retrieve the bar items, requiring the child types to include a default constructor.

Take a look at our User's Guide (section MDI Merging) for more information on how the BarItem.MergeType, BarItem.MergeOrder and the BarItem.Text properties of BarItems influence the merge behavior of those BarItems.

Automatic MDI Merging:

If you do not call this method explicitly with your child form types, the framework will call it for you when a child form (with XPMenus) gets loaded and then automatically unregister (using the UnregisterMdiChildTypes(Type[],Boolean) method) the child form type when all the corresponding instances of the child type are closed.

Delayed MDI Merging:

Sometimes you will dynamically load new child form types into your MDI. In such cases you could optionally call this method in a later stage after you access these new types and before instances of such types get parented by the MDI parent. If you do not call this method, the child's menus will still be merged (see above "Automatic MDI Merging"), but they will be removed when the child form is closed.

In such dynamic child-form loading scenarios, you might also not know whether your child forms are associated with a ChildFrameBarManager in order for you to register such types using this method. You can determine that using the BarManager.GetManagerFromForm method.

Use the UnregisterMdiChildTypes method to "unmerge" toolbars and menus from one or more child form types. Take a look at the method reference for more information.


Syncfusion.Tools.Windows: 17.4460.0.46

See Also