[Gambas-user] how to write text in indexed list of labels
Gianluigi
bagonergi at gmail.com
Sun Sep 6 19:25:48 CEST 2020
Il giorno dom 6 set 2020 alle ore 18:40 Gianluigi <bagonergi at gmail.com> ha
scritto:
>
>
> Il giorno dom 6 set 2020 alle ore 18:22 Christof Thalhofer <
> chrisml at deganius.de> ha scritto:
>
>> Am 06.09.20 um 17:58 schrieb pinglix via User:
>>
>> > 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.
>
>
> Did you mean this?
Private $iIndex As Integer
Public Sub Form_Open()
$iIndex = 123
End
Public Sub Button1_Click()
Dim obj As Object
For Each obj In Me.Controls
If obj.Name = "Label" & $iIndex Then obj.text = "Pippo"
Next
End
Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20200906/86e82815/attachment.htm>
More information about the User
mailing list