W wheable Member Licensed User Nov 6, 2019 #1 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
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
stevel05 Expert Licensed User Longtime User Nov 6, 2019 #2 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: Nov 7, 2019 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.
Erel B4X founder Staff member Licensed User Longtime User Nov 7, 2019 #3 Watch the dynamic controls tutorial: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=254862941 Upvote 0
Watch the dynamic controls tutorial: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=254862941
W wheable Member Licensed User Nov 7, 2019 #4 stevel05 said: 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. Click to expand... Thanks, Works perfectly. I'm setting the 'tag' property to uniquely identify the button. Upvote 0
stevel05 said: 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. Click to expand... Thanks, Works perfectly. I'm setting the 'tag' property to uniquely identify the button.
W wheable Member Licensed User Nov 7, 2019 #5 Erel said: Watch the dynamic controls tutorial: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=254862941 Click to expand... OK, doing it now Upvote 0
Erel said: Watch the dynamic controls tutorial: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=254862941 Click to expand... OK, doing it now