In This Article

Workspace

The workspace is the central area of a dock site hierarchy, around which tool windows are docked. It can contain optional MDI hosts or can host any other sort of content.

Screenshot

A workspace with custom content (the Actipro logo)

Control and Hierarchy

A workspace is implemented by the Workspace control. Only one Workspace can be included within a dock host hierarchy at a time.

If no workspace is within a dock host hierarchy, tool window inner-fill mode is activated.

See the Control Hierarchy topic for help on which controls can be parents to a workspace.

Workspace with Custom Content

As mentioned above, any sort of content can be placed as the child of a workspace. Just set the custom content to the Content property of the Workspace.

The screenshot above shows a workspace with custom content loaded.

When placing custom content in a workspace, a TabbedMdiHost or StandardMdiHost can optionally be the content. If neither host is defined as the workspace content, then no MDI features will be available.

Workspace with Tabbed MDI

If you want to have tabbed MDI features in your docking layout, you must place a TabbedMdiHost control directly as the Content of the Workspace.

The DockSite.MdiKind property returns Tabbed when a tabbed MDI host is present. Additionally, DockSite.PrimaryDockHost.MdiHost returns the MDI host registered with the primary dock host (the one implicitly defined within the dock site).

Tabbed MDI will not function correctly if the TabbedMdiHost is placed elsewhere.

Workspace with Standard MDI

If you want to have standard MDI features in your docking layout, you must place a StandardMdiHost control directly as the Content of the Workspace.

The DockSite.MdiKind property returns Standard when a standard MDI host is present. Additionally, DockSite.PrimaryDockHost.MdiHost returns the MDI host registered with the primary dock host (the one implicitly defined within the dock site).

Standard MDI will not function correctly if the StandardMdiHost is placed elsewhere.

MDI Only (No Tool Window Hierarchy)

In some scenarios you may wish to have MDI functionality but no tool windows surrounding the MDI area.

To achieve this, place the Workspace directly as a child of the DockSite. And use either a TabbedMdiHost or a StandardMdiHost as a child of the workspace, depending on which type of MDI you wish to have.

Switching MDI Modes at Run-Time

You can easily switch between MDI modes at run-time by setting the DockSite.MdiKind property. When switching modes, all open documents should remain open.

Determining the Location of a Tool Window in Relation to the Workspace

The ToolWindow.GetCurrentSide method can be used to determine where an open tool window is in relation to the workspace.

See the Lifecycle and Docking Management topic for some more information.