[Gambas-user] how to write text in indexed list of labels

Gianluigi bagonergi at gmail.com
Sun Sep 6 20:00:11 CEST 2020


Il giorno dom 6 set 2020 alle ore 19:45 Benoît Minisini <g4mba5 at gmail.com>
ha scritto:

> Le 06/09/2020 à 17:58, pinglix via User a écrit :
> > Hi,
> >
> > I have 200 Label components on a form with name Label1, Label2 ....
> > Label200 and I need to change the Text property of one of them through
> > an integer index.
>
> Window (and so Form) objects can be used as a collection of its children
> controls indexed by name.
>
> I.e. : MyForm["Label" & Index] will return the Label<Index> control.
>
> But you should better create such many labels dynamically and store the
> references in your own array of Labels.
>

Yes, I apologize, mine is not good Gambas code, don't use it  :-(

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20200906/1d722b96/attachment-0001.htm>


More information about the User mailing list