Back to Devexpress

How to: Enable the auto hide feature for root panels

windowsforms-5431-controls-and-libraries-docking-library-examples-how-to-enable-the-auto-hide-feature-for-root-panels.md

latest1.2 KB
Original Source

How to: Enable the auto hide feature for root panels

  • Nov 13, 2018

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