このプロジェクトは、その他のペイン内でペインをどのくらい深くネストするかを指定します。最上位(DockArea)ペインでは、NestDepth は 0 を返します。最上位ペイン内にネストされるペインは、1 を返します。
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
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinDock; using System.Diagnostics; private void btnVisibleIndex_Click(object sender, System.EventArgs e) { DockableGroupPane group = this.ultraDockManager1.DockAreas[0]; foreach(DockableControlPane pane in this.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)) { Debug.WriteLine("Is contained directly by the first dock area"); if (pane.IsVisible) Debug.WriteLine("Its visible position is " + group.Panes.GetVisiblePosition(pane)); } else if (group.Contains(pane, true)) { // 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)); } Debug.Unindent(); } }