[Gambas-user] how to write text in indexed list of labels
mbelmonte at belmotek.net
Tue Sep 8 20:23:53 CEST 2020
Were a form with 3 labels and 1 button
stx = control type, stx =control name and finaly stx =Text to
put in text property
I suggest this code
Public Sub ControlStamp(stx As String)
Dim ct As Object
Dim i As Integer
Dim colex As New Collection
If stx.Count = 3 Then
Case "TextBox", "ComboBox", "Label"
For Each ct In Me.Controls
If Object.Type(ct) = stx Then
If colex.Exist(stx) Then
colex[stx].Text = stx
Note: this form below can break the flow of the program if you give a
non-existent control name.
hlabel = Me[idName]
El 6/9/20 a las 17:58, pinglix via User escribió:
> 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.
> What is the best way to do it ?
> I cannot find a Find() method by name that returns a reference to the
> correct object.
> I can set them to the same Group but then what can I do with it ?
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User