title: Delphi: How to assign dynamically an event handler without overwriting the existing event handler?
body: <p>I need to loop through Components and assign an event handler (for example Dynamically assigning OnClick event for all TButton to</p>
  
  <pre><code>ShowMessage('You clicked on ' + (Sender as TButton).Name);
  </code></pre>
  
  <p>The problem is that in some cases I already assigned the TButton OnClick event.</p>
  
  <p>Is there a way to solve the problem?</p>
  
  <p>Let's imagine I have Button1 for which the harcoded onclick event handler is:</p>
  
  <pre><code>ShowMessage('This is Button1');
  </code></pre>
  
  <p>After my "parsing" I would like that the full event handler for Button1 becomes:</p>
  
  <pre><code>ShowMessage('This is Button1'); // design time event handler code
  ShowMessage('You clicked on ' + (Sender as TButton).Name); // runtime added
  </code></pre>
  
  <p>Note: I am looking for a soliution that allows me to use TButton as it is without inheriting from it.</p>