Delphi (Lazarus) — dynamic objects, and events?

0 like 0 dislike
3 views
Good time of day, Delphi guru and not only. The case here is this:

The procedure
procedure tform1.onbclick(Sender: TObject);

Creating during execution of the program a bunch of Button s in an array, and assign them to this procedure as the OnClick event
ArBut[i].OnClick=@onbclick;

Everything is working except the parameter Sender. As it is necessary correctly to specify in this case? Or how to get around that?


upd:

Everything works. Mixed up in procedure onbclick values for name and caption. and it is name for the dynamic creation I did not specify, so his request was empty and I thought that nothing works.
by | 3 views

1 Answer

0 like 0 dislike
ArBut[i].OnClick=@onbclick;
by

Related questions

0 like 0 dislike
2 answers
asked Mar 21, 2019 by MainNika
0 like 0 dislike
7 answers
asked Mar 21, 2019 by agul
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
28,661 users