Version

GetPreviousVisiblePane Method

Returns the visible pane preceding the specified pane.
Syntax
'Declaration
 
Public Function GetPreviousVisiblePane( _
   ByVal pane As DockablePaneBase _
) As DockablePaneBase
public DockablePaneBase GetPreviousVisiblePane( 
   DockablePaneBase pane
)

Parameters

pane
Pane with which to start the search.

Return Value

The visible pane that precedes the specified pane.
Remarks

Use this method to return visible panes in a sequence from last to first. To determine which visible pane is last in a group, use the LastVisiblePane property. You can pass the pane returned by that property as a parameter to this method to begin the enumeration of visible panes.

Example
The following example demonstrates how to walk over the children of a DockableGroupPane skipping the unpinned panes. When a group is docked, its panes collection will include all the currently docked panes - this includes any closed and unpinned panes. The DockableGroupPane exposes properties and methods for iterating the collection and only accessing the visible docked panes.

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);
		}
	}

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also