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

M0E Lnx m0e.lnx at ...626...
Wed Mar 26 21:51:11 CET 2008


:(

How about this... this may be another viable approach to getting the
same results
What if at the time the treeview is populated, I store it's contents
in an array somewhere?

When the search is ran, I'd be looking in the array instead of the
treeview, and simply re-populate the treeview with the hits at that
time.

Could this work?
Anyone have an idea how to accomplish this???... I'm not very good with arrays.


On Wed, Mar 26, 2008 at 3:00 PM, Benoit Minisini
<gambas at ...1...> wrote:
> On mercredi 26 mars 2008, jbskaggs wrote:
> > 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
> >
>
> It does not work if any item has child item. You must replace MoveNext by
> MoveBelow, and use the next 2.5 version. :-)
>
> Regards,
>
> --
> Benoit Minisini
>
>
> -------------------------------------------------------------------------
> 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
>




More information about the User mailing list