Smokeywade
Member
- Joined
- Sep 11, 2007
- Messages
- 22
- Programming Experience
- 3-5
I currently have a search that is working 50% - it finds what to search for, but it does not scroll down or up to the item that is found. I've tried creating an a component class to do this with a scroll event argument...but no luck...any ideas.
On click do go to function
do search
compClass to go to row
Thanks
On click do go to function
VB.NET:
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
do search
VB.NET:
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
compClass to go to row
VB.NET:
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
Thanks