Back to Devexpress

How to: Create a dock panel

windowsforms-5429-controls-and-libraries-docking-library-examples-how-to-create-a-dock-panel.md

latest863 B
Original Source

How to: Create a dock panel

  • Nov 13, 2018

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"