title: OnClick event for dynamic button?
body: <p>Before I start I must state that no other stack overflow post on this topic had helped me yet</p>
  
  <p>I have a dynamic button called by btnApply</p>
  
  <p>It is created dynamically on a dynamic form frmSort by a on click event of static button btnSort on static form frmTable</p>
  
  <p>Under the global scope var of frmTable is declared</p>
  
  <pre><code>btnApply: TButton;
  Procedure btnApplyClick(Sender:TObject);
  //other vars
  </code></pre>
  
  <p>Under the btnSort on click</p>
  
  <pre><code>//other code
  btnApply:= TButton.create(frmSort);
  //all its properties
  BtnApply.onclick:= btnApplyClick;
  //other code
  </code></pre>
  
  <p>Then later</p>
  
  <pre><code>Procedure btnApplyClick(Sender:TObject);
  Begin
    //it's code it has to execute
  End;
  </code></pre>
  
  <p>I get an error message at the "BtnApply.onclick:= btnApplyClick;"
  Line of incompatible types between method pointer and regular procedure</p>
  
  <p>How do I make this work?</p>
  
  <p>Thanks in advance</p>