B4J Question Is it possible to define the "tag" property for a control in scene builder ?

FranckB

Member
Licensed User
Longtime User
I would like to create several buttons in the designer with the same ID to have an unique SUB in v4J when one of these button is clicked.

Example : 2button with the ID "caract" and one with "A" as text and the second with "B" as text

I have try :

B4X:
Sub caract_MouseClicked (EventData As MouseEvent)
    Log (caract.Text)
End Sub

This code return the text of the last charged button : here "B"

In B4A, i have resolved this pb with the TAG property. Is it possible with Scene Builder ?

B4X:
Sub caract_MouseClicked (EventData As MouseEvent)
    Log (caract.Tag) ' Tag in place of Text
End Sub

Where can i fix the TAG property in the designer ?

Thank's by advance and sorry for my poor English...
 

FranckB

Member
Licensed User
Longtime User
Dim Franck as NULL !

B4X:
Sub caract_MouseClicked (EventData As MouseEvent)
Dim b As Button
b=Sender
    Log("*"&b.text&"*")
End Sub

and A is a A, B is a B ...
 
Upvote 0
Top