Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinDock
Private Sub btnVisibleIndex_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVisibleIndex.Click
Dim group As DockableGroupPane = Me.ultraDockManager1.DockAreas(0)
Dim pane As DockableControlPane
For Each pane In Me.ultraDockManager1.ControlPanes
Debug.WriteLine("Control Pane:" + pane.ToString())
Debug.Indent()
' The 'Contains' methods checks the 'Panes' of the
' group. the second argument indicates whether to
' check the children of any contained group pane.
' therefore passing in false will indicate whether
' the pane is directly contained in the panes collection
If group.Contains(pane, False) Then
Debug.WriteLine("Is contained directly by the first dock area")
If pane.IsVisible Then
Debug.WriteLine("Its visible position is " & group.Panes.GetVisiblePosition(pane))
End If
ElseIf group.Contains(pane, True) Then
' While the pane is not in the Panes collection
' of the group, it is contained within the
' dock area at a deeper level
Debug.WriteLine("Is a descendant of the first dock area")
' The nest depth indicates how many levels
' deep the pane is from the dock area
Debug.WriteLine("The pane's current nest depth is:" & pane.NestDepth)
Else
Debug.WriteLine("Is not contained within the first dock area")
Debug.WriteLine(String.Format("The pane is currently at index {0} of the pane {1}", pane.Index, pane.Parent))
End If
Debug.Unindent()
Next
End Sub