Tabbed MDI Groups

Introduction

You may have noticed that instead of using SDI or MDI, VS.NET uses a tabbed MDI interface. This interface shows a tab page for every open document. It also allows the creation of additional groups, both vertically and horizontally. The TabbedGroups control in NetXP allows you to recreate this interface in your own applications.

Terminology

When using the TabbedGroups control, you should be aware of what certain terms mean. Here they are described in more detail.

Usage

Adding Groups

The TabbedGroups control in NetXP 3.0 does not currently have design-time support. As a result, once you have added it to your form from the toolbox, you can only utilize it through code. You can set up the properties and events at design time, but you can't manage groups at design time.

To add a tabbed group to the TabbedGroups control, use the control's RootSequence property and call AddNewNode. This creates a new tabbed group. Then, to add tab pages to the group, use the group's TabPages property to add a new tab page to the group.

Example:

	TabGroupNode tn = this.tabbedGroups1.RootSequence.AddNewNode();
	tn.TabPages.Add(new NETXP.Controls.Docking.TabPage("Test 1"));
	tn.TabPages.Add(new NETXP.Controls.Docking.TabPage("Test 2"));
	tn = this.tabbedGroups1.RootSequence.AddNewNode();
	tn.TabPages.Add(new NETXP.Controls.Docking.TabPage("Test 3"));

The above example creates two vertical tabbed groups. The first group (on the left) shows two tab pages entitled Test 1 and Test 2. The second group (on the right) shows one tab page entitled Test 3.

The Active Node

The active node is the node which has the focus, or the last node which had the focus. There is always an active node as long as there is at least one tabbed group added to the TabbedGroups control. The TabbedGroups.ActiveNode property is used to find out which tabbed group is the currently active one and handle the ActiveNodeChanged event to be notified when the active node changes. This is useful when you must  add a new tab page to the TabbedGroups control. In this case, you should add the new page to the active node rather than adding it to the first node in the sequence.

Saving and Loading Layout

To automatically save and load layout, you can use the TabbedGroups.SaveConfigTo... and TabbedGroups.LoadConfigFrom... methods, just like you do with the docking manager.