Skip to main content
A newer version of this page is available. .

DockManager.Form Property

Gets or sets the container control (form or user control) which displays the dock panels owned by the current dock manager.

Namespace: DevExpress.XtraBars.Docking

Assembly: DevExpress.XtraBars.v19.2.dll

Declaration

[DefaultValue(null)]
[DXCategory("Layout")]
public ContainerControl Form { get; set; }

Property Value

Type Default Description
ContainerControl *null*

A ContainerControl object that is the container which displays the dock panels created by the current dock manager.

Remarks

When creating a dock manager in code the Form property has to be initialized manually to specify the container control which will display the dock panels created by the dock manager. When adding a DockManager component onto a form at design time, the Form property is initialized automatically.

If the Form property is not set, an exception will occur when dock panels are added to the dock manager.

Setting the Form property to null or a another valid container will destroy all panels owned by the DockManager.

Example

The following code shows how to add a dock manager to a form and create a panel.

using DevExpress.XtraBars.Docking;
// ...
// Create a dock manager
DockManager dm = new DockManager();
// Specify the form to which the dock panels will be added
dm.Form = this;
// Create a new panel and dock it to the left edge of the form
DockPanel dp1 = dm.AddPanel(DockingStyle.Left);
dp1.Text = "Panel 1";
See Also