Gets the next sibling tree node.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The following code example selects the appropriate TreeNode after determining if the TreeNode passed in is selected and which TreeNode to select. This example requires that you have a Form with a TreeView control that has a TreeNodeCollection that contains several TreeNode objects. It also requires that you have a ComboBox with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last".
Private Sub SelectNode(node As TreeNode) If node.IsSelected Then ' Determine which TreeNode to select. Select Case myComboBox.Text Case "Previous" node.TreeView.SelectedNode = node.PrevNode Case "PreviousVisible" node.TreeView.SelectedNode = node.PrevVisibleNode Case "Next" node.TreeView.SelectedNode = node.NextNode Case "NextVisible" node.TreeView.SelectedNode = node.NextVisibleNode Case "First" node.TreeView.SelectedNode = node.FirstNode Case "Last" node.TreeView.SelectedNode = node.LastNode End Select End If node.TreeView.Focus() End Sub
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.