title: how to write a function Click() for dynamic created button?
body: <p>Trying to write a simple VCL program for educating purposes (dynamicly created forms, controls etc). Have such a sample code:</p>
  
  <pre><code>void __fastcall TForm1::Button1Click(TObject *Sender)
  {
      TForm* formQuiz = new TForm(this);
      formQuiz-&gt;BorderIcons = TBorderIcons() &lt;&lt; biSystemMenu &gt;&gt; biMinimize &gt;&gt; biMaximize;
      formQuiz-&gt;Position = TPosition::poDesktopCenter;
      formQuiz-&gt;Width = 250;
      formQuiz-&gt;Height = 250;
      formQuiz-&gt;Visible = true;
  
      TButton* btnDecToBin = new TButton(formQuiz);
      btnDecToBin-&gt;Parent = formQuiz;
      btnDecToBin-&gt;Left = 88;
      btnDecToBin-&gt;Top = 28;
      btnDecToBin-&gt;Caption = "Dec to Bin";
      btnDecToBin-&gt;Visible = true;
  }
  </code></pre>
  
  <p>I wonder how can i write a function for dynamic created button, so it would be called when the button is clicked. In this example i need a 'btnDecToBin->Click();' func but i don't know where should i place it.</p>
  
  <p>Inside '<code>void __fastcall TForm1::Button1Click(TObject *Sender){}</code>' ?</p>
  
  <p>I will appreciate any input, some <strong>keywords</strong> for google too.</p>