[Gambas-user] how to place code into events of an array of buttons?

T Lee Davidson t.lee.davidson at gmail.com
Tue Feb 1 22:58:33 CET 2022


On 2/1/22 16:36, Bruce Steers wrote:
> Thinking about it if you've made the global btns[] array just that would suffice for Find() in a Click event using Last.
> 
> 
> Public Sub btns_Click()
> 
>     Dim iIndex As Integer = btns.Find(Last)
> 
> End
> 
> Job done :)
> BruceS

I originally thought about doing it that way. But, also thought it wouldn't work because 'btns' doesn't know its own name, and I 
was still stuck on passing Last.Name.

However, passing the buttons handle (id) to the Find method does indeed work, quite nicely.


-- 
Lee


More information about the User mailing list