DockManager Class
The component that allows you to create docked, floating and/or auto-hidden dock panels inside a form or user control. See Docking Library.
Namespace: DevExpress.XtraBars.Docking
Assembly: DevExpress.XtraBars.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
[SerializationOrder(Order = 1)]
public class DockManager :
Component,
ISupportInitialize,
IXtraSerializable,
IXtraSerializableLayout,
IXtraSerializableLayout2,
ISupportBrokenLayoutExceptionHandling,
IBarAndDockingControllerClient,
ISupportXtraSerializer,
ISnapSupport,
IStyleDockZone,
ILogicalOwner,
IScaleComponentNotificationClient,
IObserver<IScaleComponentNotification>,
IXtraSupportForceInitialize,
IDocumentAdapterFactory,
IWindowedDocumentAdapterFactory,
ISizingAdornerOwner,
IDesignTimeDockManager
Related API Members
The following members return DockManager objects:
Remarks
The DockManager
class represents a component used to manage dock panels.
To add docking functionality for a specific container control (form or user control), you need to create a DockManager
object and set its DockManager.Form property so that it refers to this control. If the DockManager.Form property is set to null, dock panels cannot be created.
The DockManager
class provides the DockManager.AddPanel method for creating dock panels. To create split and tab containers, the DockPanel.AddPanel, DockPanel.DockTo and DockPanel.DockAsTab methods can be used.
The currently active dock panel is determined by the DockManager.ActivePanel property.
Panels that belong to the dock manager can be accessed using the following members:
- DockManager.RootPanels stores visible floating or docked panels which are not owned by other panels
- DockManager.HiddenPanels allows you to iterate through hidden panels
- DockManager.AutoHideContainers provides access to the panels which have their automatic hiding functionality enabled.
Note
Because of possible conflicts, do not place multiple dock managers on a single form/user control. Instead, use a single dock manager or use multiple dock managers, each of which is displayed within its own UserControl object.
Important
When a DockManager
is placed on a RibbonForm, you may notice slow performance during control startup rendering for complex projects. To resolve the issue, call the DockManager.ForceInitialize method on form loading.
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";