Treeview / Listview search code

  • Thread starter Thread starter DP
  • Start date Start date
D

DP

Would anyone be able to provide me with the code fragments for searching
text strings (*x*) in both Treeview and Listview controls?

With Treeview controls it would, I assume, be impossible to do any kind of
multiselect, and I don't know whether code would work to continue through
the treeview nodes - selecting the first node that contains the search code,
then the next, on through to the last.

With Listview, since it can be set to multiselect, I would assume that
search code COULD select all the items matching the string.

Thank you, David Pike
 
try something like this:

dim n as node
for each n in oTV.nodes
if n.text like "*x*" then
'found!
n.selected=true
exit for
end if
next
 
Back
Top