下列代码展示了如何把一个停靠管理器添加到窗体中,并创建一个面板。

C#CopyCode image复制代码
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";

Visual BasicCopyCode image复制代码
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"