B4J Question Array of buttons

wheable

Member
Licensed User
I have an array of 24 buttons . If I give them identical event names in designer can I handle their click events in a single event handler . If so how do I pass the name of the button to this event handler so it can tell which button generated the event ?

Any help gratefully received
 
You don't need to pass the name, the keyword Sender will point to the object (button) that raised the event so inside the click event:
Code:
Dim B As Button = Sender
Log(B.Text)
Then B will point to the button that raised the event.
 
Last edited:
Upvote 0
You don't need to pass the name, the keyword Sender will point to the object (button) that raised the event so inside the click event:
Code:
Dim B As Button = Sender
Log(B.Text)
Then B will point to the button that raised the event.
Thanks, Works perfectly. I'm setting the 'tag' property to uniquely identify the button.
 
Upvote 0
Back
Top