Back to Devexpress

DockManager(ContainerControl) Constructor

windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockmanager-dot-ctor-x28-system-dot-windows-dot-forms-dot-containercontrol-x29.md

latest2.9 KB
Original Source

DockManager(ContainerControl) Constructor

Initializes a new instance of the DockManager class with the specified container control.

Namespace : DevExpress.XtraBars.Docking

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public DockManager(
    ContainerControl form
)
vb
Public Sub New(
    form As ContainerControl
)

Parameters

NameTypeDescription
formContainerControl

A ContainerControl object representing the container control that will display the dock panels owned by the created dock manager.

|

Remarks

The constructor initializes all the fields to their default values.

The form parameter is used to initialize the DockManager.Form property. It represents the container control (form or user control) that will display the dock panels owned by the dock manager. The DockManager.Form property must refer to a valid control (not null ), otherwise an exception will occur when adding panels to the dock manager.

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

Form

DockManager Class

DockManager Members

DevExpress.XtraBars.Docking Namespace