Xceed Docking Windows for WinForms v2.3 Documentation
How to move a group of ToolWindows programmatically

Welcome to Xceed Docking Windows for WinForms v2.3 > Task-Based Help > How to move a group of ToolWindows programmatically

At runtime, a group of Tool Windows can be moved by either double-clicking in the active tool window's caption or by dragging the group to another location. Programmatically, to accomplish the same behavior, the DockTo method of the ParentGroup of any one of the tool windows in the group must be used. 

If, rather than using the DockTo method, the parent group's State property is changed to Docked, each tool window in the group will return to its own last known docked location. If a tool window had never previously been docked, it will be docked to the left of the DockHost. Keep in mind that if a tool window is docked within a floating tool window, then its state is considered to be floating and not docked. 

Every time the state, visibility, or location of a tool window is changed its parent group is also modified. It is required to always access a ToolWindowGroup via the ParentGroup property and to never cache this property value.

Example

The following code demonstrates how to move a grouped set of floating tool windows (see the image below) so that they are docked (and grouped) to the right of the dock-host.  

This example assumes that a Dock-layout Manager has been instantiated (m_manager) and contains a group of tool windows. This example also assumes that there is a panel on a form named clientHostPanel and that it is the set as the client-host of the dock-layout manager.

VB.NET Copy Code

m_manager.ToolWindows( 0 ).ParentGroup.DockTo( DockTargetHost.DockHost, DockPosition.Right )

C# Copy Code

m_manager.ToolWindows[ 0 ].ParentGroup.DockTo( DockTargetHost.DockHost, DockPosition.Right );

The above code results in the all the tool windows being grouped and docked to the right of the dock-host.