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

Discussion in 'B4J Questions' started by FranckB, Feb 4, 2015.

Similar threads

B4J Tutorial Unhandled exceptions
B4J Tutorial Magnifying glass example
B4J Code Snippet Cool zooming effect
B4J Tutorial FlickrViewer
B4J Code Snippet Save changes before closing with a resumable sub
B4J Tutorial UI App (JavaFX) Tutorial
  1. FranckB

    FranckB Member Licensed 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 :

    Code:
    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 ?

    Code:
    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...
     
  2. FranckB

    FranckB Member Licensed User

    Dim Franck as NULL !

    Code:
    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 ...
     
  3. stevel05

    stevel05 Expert Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice