B4J Question [4.50] Button_Action not firing?

LWGShane

Well-Known Member
Licensed User
Longtime User
B4X:
Sub Button_Action
    Dim Btn As Button = Sender
    Dim Text As String = Btn.Text.Replace(" ", "_")
    LogDebug("Sub_" & Text)
    If SubExists(Me, Text) Then CallSub(Me, Text)
End Sub

The above code won't work when I click on any of the buttons I have on my form. Any ideas?
 

LWGShane

Well-Known Member
Licensed User
Longtime User
What is the button's EventName value?
I'm actually trying to have Button_Action be like Menu_Action (So I can have one Sub for multiple buttons.)
 
Upvote 0

inakigarm

Well-Known Member
Licensed User
Longtime User
You can process all button action event in one Action event if you set a different tag property to each button, and set the same event to all buttons

Later in the Event, get the sender (as you did) and check the text tag in a Select Case to decide which button has fired the event, and set the properly code to each button action
 
Upvote 0
Top