user3747121
user3747121

Reputation: 11

How to shift the control to next node of Treeview using visual basic

How to shift the control to next node of Treeview using visual basic. if clicked on button named as "NEXT", then the cursor should shift to down ward node of treeview. thanks a lot

Upvotes: 1

Views: 399

Answers (1)

Alex K.
Alex K.

Reputation: 175816

Use the index property

If Not tvw.SelectedItem Is Nothing Then
    If (tvw.SelectedItem.Index < tvw.Nodes.Count) Then
        With tvw.Nodes(tvw.SelectedItem.Index + 1)
            .Selected = True
            .Expanded = True
            .EnsureVisible
        End With
    End If
End If

Upvotes: 1

Related Questions