Back to Devexpress

DockManager.Form Property

windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockmanager-1f3b18e0.md

latest2.8 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(null)]
[DXCategory("Layout")]
public ContainerControl Form { get; set; }
vb
<DefaultValue(Nothing)>
<DXCategory("Layout")>
Public Property Form As ContainerControl

Property Value

TypeDefaultDescription
ContainerControlnull

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.

csharp
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";
vb
Imports DevExpress.XtraBars.Docking
' ...
' Create a dock manager
Dim dm As DockManager = New DockManager
' Specify the form to which the dock panels will be added
dm.Form = Me
' Create a new panel and dock it to the left edge of the form
Dim dp1 As DockPanel = dm.AddPanel(DockingStyle.Left)
dp1.Text = "Panel 1"

See Also

DockManager Class

DockManager Members

DevExpress.XtraBars.Docking Namespace