mrjaw Active Member Licensed User Longtime User Aug 12, 2015 #1 Hi! I need to create a few button depending of records in a table. I mean if I have 5 records in the table I will create 5 buttons. My problem is how can I create the name of any button and create the method/Sub for each button. Ex: for i=1 to 5 Dim "b" & i as Button next I have b1, b2...b5 as button There is anyway to do this ?
Hi! I need to create a few button depending of records in a table. I mean if I have 5 records in the table I will create 5 buttons. My problem is how can I create the name of any button and create the method/Sub for each button. Ex: for i=1 to 5 Dim "b" & i as Button next I have b1, b2...b5 as button There is anyway to do this ?
R Roycefer Well-Known Member Licensed User Longtime User Aug 12, 2015 #2 Give them all the same event name and then use Sender inside the event sub to figure out which button triggered the event. Also, Code: Copy Dim "b" & i as Button won't work. Instead, create an array of Buttons and put some identifying info in their Tag properties. Upvote 0
Give them all the same event name and then use Sender inside the event sub to figure out which button triggered the event. Also, Code: Copy Dim "b" & i as Button won't work. Instead, create an array of Buttons and put some identifying info in their Tag properties.
Erel B4X founder Staff member Licensed User Longtime User Aug 14, 2015 #3 See this tutorial: Tick-Tack-Toe: working with arrays of views Upvote 0