Version

Tab Serialization

The layout and settings of the tabs and tab groups may be persisted using the SaveAsBinary or SaveAsXml methods of the UltraTabbedMdiManager . This is usually done when the form is closing so the user interface may be reloaded when the application is run again. To load the layout, use the LoadFromBinary or LoadFromXml method depending on which mechanism you used to save the layout.

When the save method is invoked, the StoreTab event will be invoked for each MdiTab . This may be used to initialize the PersistedInfo property of the MdiTab object with a serializable value that can be used during the restoration to determine what form the tab should be associated with. For example, you might store the filename of a document if the tab was associated with a particular file.

When the load method is invoked, any references to existing tabs and tab groups are released and the RestoreTab event is invoked for each serialized MdiTab object. This is to provide an opportunity to associate the MdiTab with either an existing Form or a new Form. The PersistedInfo property may be used to determine which form to create or associate with the tab.

Once the RestoreTab event has been invoked for each serialized tab, any MdiTab objects that are not associated with a form are released. Tab groups that do not contain any MdiTab objects are also released. New MdiTab objects will be created for MDI child forms that are not associated with an MdiTab. The InitializeTab event will be invoked for these tabs to allow their settings to be initialized. Also, the tabs may be moved from the HiddenTabs collection to a tab group (or vice versa) depending on the visibility of the form it is associated with.

Note
Note

An MdiTab can only be associated with a single Form so if in the RestoreTab event, you specify a Form that is already associated with an MdiTab, the Form will be associated with the tab provided in the event and the previous MdiTab will be released.