[Gambas-user] treeview multiple selection

Werner wdahn at ...1000...
Thu Aug 13 11:01:53 CEST 2009


Jean-Yves F. Barbier wrote:
> Hi list,
>
> Is there a possibility to make a multiple selection in a treeview
> by program, not by mouse.
>
> I've got 2 treeviews: 1st is a group list, 2nd is users (only some users are
> part of a specific group)
> What I'd like is to select all users belonging to a group I "mouse-select"
> to visually show the connection.
>
> and if there's a manner to change the users selected colors, I'm in too.
>
> JY
>   
say you have a treeview called Larch. The following stub (untested)
should select all treeview items that begin with "A" and deselect all others

if not Larch.MoveFirst then
    repeat
       if Left$(Larch.Item.Text) = "A" then
            Larch.Item.Selected = TRUE
            else
             Larch.Item.Selected = FALSE
       endif
    until Larch.MoveNext
endif

Regards
Werner





More information about the User mailing list