On click do go to function
Expand|Select|Wrap|Line Numbers
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- funcgetnode()
- If TextBox2.Text <> funcgetnode() Then
- MessageBox.Show("Nothing found")
- Else
- treeListView1.Focus()
- End If
- End Sub
Expand|Select|Wrap|Line Numbers
- Function funcgetnode()
- Dim x As String = TextBox2.Text
- Dim i As Integer
- Dim nextnode As New TreeListNode
- Dim innode As New TreeListNode
- nextnode = nextnode.FirstChild
- For i = 0 To treeListView1.Nodes.Count - 1
- treeListView1.Nodes(i).Selected = False
- If treeListView1.Nodes(i).SubItems(0).ToString = x Then
- TextBox1.Text = "found"
- treeListView1.Nodes(i).Selected = True
- treelistview1.goTorow(i)
- funcgetnode = treeListView1.Nodes(i).SubItems(0).ToString
- End If
- Next
- End Function
Expand|Select|Wrap|Line Numbers
- Sub goTorow(ByVal row As Integer)
- If Not Me.DataBindings Is Nothing Then
- Me.scrollable = True
- Me.OnNodesChanged(Me, New ScrollEventArgs(ScrollEventType.LargeIncrement, row))
- End If
- End Sub