Delphi: How to assign dynamically an event handler without overwriting the existing event handler?
- by user193655
I need to loop through Components and assign an event handler (for example Dynamically assigning OnClick event for all TButton to
ShowMessage('You clicked on ' + (Sender as TButton).Name);
The problem is that in some cases I alreasy assigned the TButton OnClick event.
Is there a way to solve the problem?
Let's imagine I have Button1 for which…