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