Re: search text in treeview
Try this
vb Code:
TextToSearch = "strip"
Dim X As Integer
For X = TV.Nodes.Count To 1 Step -1
If TextToSearch = TV.Nodes(X).Text Then
TV.Nodes.Remove X
End If
Next X
Notes:
1- Nodes lower bound is 1 not 0
2- When you need to remove node inside a loop, you must use reverse order loop.
Re: search text in treeview
Quote:
Originally Posted by
4x2y
Try this
vb Code:
TextToSearch = "strip"
Dim X As Integer
For X = TV.Nodes.Count To 1 Step -1
If TextToSearch = TV.Nodes(X).Text Then
TV.Nodes.Remove X
End If
Next X
Notes:
1- Nodes lower bound is 1 not 0
2- When you need to remove node inside a loop, you must use reverse order loop.
this is work like a charm...Thanks a lot and mark as solved...
Re: search text in treeview
As you now have it sorted out, could you please do us a little favour, and mark the thread as Resolved?
(this saves time reading for those of us who like to answer questions, and also helps those who search to find answers)
You can do it by clicking on "Thread tools" just above the first post in this thread, then "Mark thread resolved". (like various other features of this site, you need JavaScript enabled in your browser for this to work).