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.
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 |
---|---|
|
C# | Copy Code |
---|---|
|