[Gambas-user] How to search for an item in a treeview

jbskaggs jbskaggs at ...1871...
Wed Mar 26 20:02:58 CET 2008



I would have the program movenext thru each item starting at movefirst and
run the instr function on each string for each treeview.item until you get a
hit.

I do this to search for specific key words in text, keys, images in my
treeview.  Im  newbie so this may not work exactly right but this worked for
me.

sample:

dim j as string
dim i as integer
j="yoursearchstring"
yourtreeview.movefirst
for i = 1 to yourtreeview.count
     yourtreeview.item.selected=true
        if instr(yourtreeview.item.text, j)>0
        do your code here
        endif
     yourtreeview.movenext
next

JB SKaggs


M0E Lnx wrote:
> 
> I have a treeview populated with lots of entries... I'm trying to
> provide a function that would search within the contents of that
> treeview for a specific string.
> Can anyone think of a way to do that?
> 
> I've been trying the FIND method in the treeview, but it's quite
> different from other find methods...
> 
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-search-for-an-item-in-a-treeview-tp16311949p16313314.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list