I always avoided using Sender because I didn't really understand the concept and was fine with creating different subs for each button or label clicked.
Now I'm in need of reacting to clicks of more buttons or labels then before, so I began looking into the Sender object. Above code really helped a lot to understand what's happening.
As in the demo I can make a series of labels in code, and when clicked I am able to set a new Text for the label, like this :
Private Sub Label_Click
Dim v As B4XView = Sender
xui.MsgboxAsync("ID Tag: " & v.tag, "Label Click")
v.Text = "Hello world!"
End Sub
But now I would like to change the Text for all or some labels without being clicked on.
How do I reference any or all labels in the demo and change the Text (or any other) property?