Only been using 4BA since Christmas (had to do something to avoid clearing up!). I've used VB6 on and off for years, but finding the syntax for 4BA frustrating.
Simple problem, I need to know which label in an array was clicked.
Sub Globals
Dim lbllabel(6) As Label
Dim X As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
For X = 1 To 5
lbllabel(X).Initialize("")
lbllabel(X).TextSize=40
lbllabel(X).Text = X
lbllabel(X).TextColor =Colors.Black
lbllabel(X).Gravity = Gravity.CENTER_HORIZONTAL + Gravity.CENTER_VERTICAL
lbllabel(X).Color = Colors.Cyan
Activity.AddView(lbllabel(X), 300*X+0dip, 20dip, 80dip, 80dip)
Next
End Sub
Sub lblClick_Click
Dim lbl As Label
lbl = Sender
Select lbl
Case 1
Case 2
Case 3
etc
End Select
End Sub
I realize this is a noob question, in VB i knew the answer 25 years ago
Simple problem, I need to know which label in an array was clicked.
Sub Globals
Dim lbllabel(6) As Label
Dim X As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
For X = 1 To 5
lbllabel(X).Initialize("")
lbllabel(X).TextSize=40
lbllabel(X).Text = X
lbllabel(X).TextColor =Colors.Black
lbllabel(X).Gravity = Gravity.CENTER_HORIZONTAL + Gravity.CENTER_VERTICAL
lbllabel(X).Color = Colors.Cyan
Activity.AddView(lbllabel(X), 300*X+0dip, 20dip, 80dip, 80dip)
Next
End Sub
Sub lblClick_Click
Dim lbl As Label
lbl = Sender
Select lbl
Case 1
Case 2
Case 3
etc
End Select
End Sub
I realize this is a noob question, in VB i knew the answer 25 years ago