Saturday, September 17, 2011

Find Node in TreeView

You need Treeview control, one TextBox control and one Button. The TextBox control you are using for the name of the searched Treeview node. Into the Button write the code bellow:

Try
        Dim node1() As TreeNode = TreeView1.Nodes(0).Nodes.Find(Text1.Text, True)
        Dim i As Integer = 0

        For i = 0 To node1.Length
            TreeView1.SelectedNode = node1(i)
        Next i
    Catch
    End Try

1 comment:

There was an error in this gadget