Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinDock Private Sub btnIterateVisible_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnIterateVisible.Click Me.WalkPanes(Me.ultraDockManager1.DockAreas(0), Me.chkIterateForward.Checked) End Sub Private Sub WalkPanes(ByVal group As DockableGroupPane, ByVal forward As Boolean) If (Not group.IsVisible) Then Debug.WriteLine(String.Format("Group '{0}' is not visible", group)) Return ElseIf (Not group.HasChildPanes()) Then Debug.WriteLine(String.Format("Group [{0}] has no child panes.", group)) Return End If ' Display the number of visible panes that the group ' contains using the GetVisibleCount method Debug.WriteLine(String.Format("Group [{0}] contains {1} visible panes:", group, group.Panes.GetVisibleCount())) Debug.WriteLine(New String("=", Math.Max(0, 50 - (Debug.IndentLevel * Debug.IndentSize)))) ' You can see how many unpinned panes are contained by a group ' by checking the 'GetUnpinnedCount' method of the group's 'Panes' property Dim unpinnedCount As Integer = group.Panes.GetUnpinnedCount() If (unpinnedCount > 0) Then Debug.WriteLine(String.Format("The group contains {0} unpinned pane(s)", unpinnedCount)) End If Dim pane As DockablePaneBase = Nothing If (forward) Then ' Let the group get the first visible pane pane = group.FirstVisiblePane Do While Not pane Is Nothing Debug.WriteLine("Pane:" + pane.ToString()) ' Walk down the chain to display the info ' for the pane if the pane itself is a group pane If TypeOf pane Is DockableGroupPane Then Debug.Indent() Me.WalkPanes(pane, forward) Debug.Unindent() End If ' Get the subsequent visible pane pane = group.GetNextVisiblePane(pane) Loop Else ' Get the visible pane starting at the end pane = group.LastVisiblePane Do While Not pane Is Nothing Debug.WriteLine("Pane:" + pane.ToString()) ' Walk down the chain to display the info ' for the pane if the pane itself is a group pane If TypeOf pane Is DockableGroupPane Then Debug.Indent() Me.WalkPanes(pane, forward) Debug.Unindent() End If ' Get the visible pane that is displayed before ' the specified pane pane = group.GetPreviousVisiblePane(pane) Loop End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinDock; using System.Diagnostics; private void btnIterateVisible_Click(object sender, System.EventArgs e) { this.WalkPanes( this.ultraDockManager1.DockAreas[0], this.chkIterateForward.Checked ); } private void WalkPanes( DockableGroupPane group, bool forward ) { if (!group.IsVisible) { Debug.WriteLine(string.Format("Group '{0}' is not visible", group)); return; } else if (!group.HasChildPanes()) { Debug.WriteLine(string.Format("Group [{0}] has no child panes.", group)); return; } // Display the number of visible panes that the group // contains using the GetVisibleCount method Debug.WriteLine(string.Format("Group [{0}] contains {1} visible panes:", group, group.Panes.GetVisibleCount())); Debug.WriteLine( new String('=', Math.Max(0, 50 - (Debug.IndentLevel * Debug.IndentSize))) ); // You can see how many unpinned panes are contained by a group // by checking the 'GetUnpinnedCount' method of the group's 'Panes' property int unpinnedCount = group.Panes.GetUnpinnedCount(); if (unpinnedCount > 0) Debug.WriteLine(String.Format("The group contains {0} unpinned pane(s)", unpinnedCount)); DockablePaneBase pane = null; if (forward) { // Let the group get the first visible pane pane = group.FirstVisiblePane; while (pane != null) { Debug.WriteLine("Pane:" + pane.ToString()); // Walk down the chain to display the info // for the pane if the pane itself is a group pane if (pane is DockableGroupPane) { Debug.Indent(); this.WalkPanes(pane as DockableGroupPane, forward); Debug.Unindent(); } // Get the subsequent visible pane pane = group.GetNextVisiblePane(pane); } } else { // Get the visible pane starting at the end pane = group.LastVisiblePane; while (pane != null) { Debug.WriteLine("Pane:" + pane.ToString()); // Walk down the chain to display the info // for the pane if the pane itself is a group pane if (pane is DockableGroupPane) { Debug.Indent(); this.WalkPanes(pane as DockableGroupPane, forward); Debug.Unindent(); } // Get the visible pane that is displayed before // the specified pane pane = group.GetPreviousVisiblePane(pane); } } }