Back to Devexpress

DockManager.Panels Property

windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockmanager-8a85c50f.md

latest3.3 KB
Original Source

DockManager.Panels Property

Provides access to all the dock panels owned by the dock manager.

Namespace : DevExpress.XtraBars.Docking

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
[XtraSerializableProperty(true, true, true)]
public ReadOnlyPanelCollection Panels { get; }
vb
<Browsable(False)>
<XtraSerializableProperty(True, True, True)>
Public ReadOnly Property Panels As ReadOnlyPanelCollection

Property Value

TypeDescription
ReadOnlyPanelCollection

A ReadOnlyPanelCollection object representing the collection of dock panels.

|

Remarks

The Panels property provides access to all the dock panels owned by the current dock manager. The collection object which is returned contains the visible, hidden and auto-hidden dock panels. The returned collection is read only. You can only access panel(s) or determine whether a collection contains a particular panel. Refer to the Creating and Destroying Dock Panels document for information on how to create and destroy dock panels.

To access only the hidden or auto-hidden panels, use the DockManager.HiddenPanels and DockManager.AutoHideContainers properties, respectively.

Note

The Panels collection’s items can only be accessed after the form is loaded. Do not attempt to access it within a form constructor, since the Panels collection will be empty at that moment. Handle the form’s OnShown or OnLoad events instead (see the code below).

csharp
protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);
            foreach (DevExpress.XtraBars.Docking.DockPanel pane in dockManager1.Panels)
            {
               . . .
            }
        }
vb
Protected Overrides Sub OnShown(ByVal e As EventArgs)
        MyBase.OnShown(e)
        For Each pane As DevExpress.XtraBars.Docking.DockPanel In dockManager1.Panels
                . . .
        Next pane
 End Sub

See Also

HiddenPanels

AutoHideContainers

Creating and Destroying Dock Panels

DockManager Class

DockManager Members

DevExpress.XtraBars.Docking Namespace