[Gambas-user] Hope I'm doing this correctly - I'm searching for help to reference a control using a variable
Gianluigi
bagonergi at gmail.com
Thu Mar 22 09:31:55 CET 2018
Hi, David,
You can do this:
Public Sub Form_Open()
Label1.Border = Border.Plain
Label1.Alignment = Align.Center
End
Public Sub Button1_Click()
Dim sString As String ' Defaul is ""
Dim iInt As Integer
iInt = 2753 + 235
sString = "Sum result = " & CStr(iInt)
Label1.text = sString
' or
' Label1.Text = "Sum result = " & CStr(2753 + 235)
End
Regards
Gianluigi
2018-03-22 5:07 GMT+01:00 David Eaton via User <user at lists.gambas-basic.org>
:
> I'm new to this mailing list idea - I don't know how they work or if I'm
> posting into the correct one.
>
> I am looking for some help in programming with Gambas. In particular, I
> have a program that has several label controls. I need to be able to set
> properties on these labels via a variable - similar to this pseudo code:
>
> dim stringx as string = ""
> dim myint as integer = 1
>
> myint = somenumber_determined_at_runtime
> stringx = "Label" & myint
> Stringx.propertiy = somevalue_determined_at_runtime
>
> I was able to do this in Visual Basic following some samples on the
> internet.
>
> Is there a way to do this in Gambas?
>
> Thank you, and if I have put this in the completely wrong place please let
> me know.
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List:
> https://lists.gambas-basic.org/listinfo/user
>
> Search the list:
> https://lists.gambas-basic.org/cgi-bin/search.cgi
>
> Hosted by https://www.hostsharing.net
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180322/ac2aed93/attachment.html>
More information about the User
mailing list