Hello All;
I have a button loaded in ScrollView2D. I would like to get the index of the button I press. in CustomListView I used to get the index by this code
The usual way to do this is to put a value in the button.Tag, and then read it from the "Sender" in a common click handler, much as you describe in your example ...
B4X:
Sub button_Click
Dim btn As Button = Sender
Dim index As Int = btn.tag
xui.MsgboxAsync("Button number" & index, "Button clicked")
End Sub
The usual way to do this is to put a value in the button.Tag, and then read it from the "Sender" in a common click handler, much as you describe in your example ...
B4X:
Sub button_Click
Dim btn As Button = Sender
Dim index As Int = btn.tag
xui.MsgboxAsync("Button number" & index, "Button clicked")
End Sub