Back to Devexpress

DockManager.RootPanels Property

windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockmanager-115173da.md

latest4.2 KB
Original Source

DockManager.RootPanels Property

Provides access to the collection of visible panels which are not owned by other panels.

Namespace : DevExpress.XtraBars.Docking

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
public DockPanelCollection RootPanels { get; }
vb
<Browsable(False)>
Public ReadOnly Property RootPanels As DockPanelCollection

Property Value

TypeDescription
DockPanelCollection

A DockPanelCollection object.

|

Remarks

The RootPanels property provides access to the collection of visible panels which are not owned by other panels. This collection includes:

  • visible floating panels which are not owned by any other floating panels. The Parent properties of these panels are represented by FloatForm objects.
  • visible panels docked to the dock manager’s DockManager.Form. These panels are not owned by other panels and therefore the Parent properties of these panels refer to the DockManager.Form object.

The RootPanels collection doesn’t include panels which belong to other panels and panels which have their DockPanel.Visibility property set to DockVisibility.Hidden and DockVisibility.AutoHide.

To access hidden panels use the DockManager.HiddenPanels collection. The panels which have their auto-hide functionality enabled can be obtained via the DockManager.AutoHideContainers collection.

Use index notation to get the child panels of a specific panel.

Example

The following code demonstrates how to enable the auto hide feature for all root panels residing on the dock manager’s form. Floating panels are not affected by this code.

csharp
using DevExpress.XtraBars.Docking;
// ...
int index = 0;
while(index < dockManager1.RootPanels.Count) {
   DockPanel rootPanel = dockManager1.RootPanels[index];
   // Enable the auto hide functionality if the panel is not floating.
   if(rootPanel.FloatForm == null)
      rootPanel.Visibility = DockVisibility.AutoHide;
   else
      index++;
}
vb
Imports DevExpress.XtraBars.Docking
' ...
Dim index As Integer = 0
While index < DockManager1.RootPanels.Count
   Dim rootPanel As DockPanel = DockManager1.RootPanels(index)
   ' Enable the auto hide functionality if the panel is not floating.
   If (rootPanel.FloatForm Is Nothing) Then
      rootPanel.Visibility = DockVisibility.AutoHide
   Else
      index = index + 1
   End If
End While

See Also

AutoHideContainers

Count

HiddenPanels

Item[Int32]

Visibility

DockManager Class

DockManager Members

DevExpress.XtraBars.Docking Namespace