title: How to execute event on dynamic generated text box in c# imminently when text box created
body: <p>I created Dynamic Text Box using List in C# and i want to execute event immediately after text box is created </p>
  
  <p>Following is my code.</p>
  
  <pre><code>    private List&lt;TextBox&gt; txtTotalCost = new List&lt;TextBox&gt;();
  
      private void btnMaterialAdd_Click(object sender, EventArgs e)
      {
          TextBox tbTotalCost = new TextBox();
          tbTotalCost.Location = new Point(652, RowCount * 22);
          tbTotalCost.Width = 60;
          txtTotalCost.Add(tbTotalCost);
          tbTotalCost.MouseClick += tbTotalCost_TextChanged;
          panel1.Controls.Add(tbTotalCost);
       }
  
      void tbTotalCost_TextChanged(object sender, EventArgs e)       
      {
          TextBox tb = (TextBox)sender;
          TotalCost = CanadianCost * Qut;
          tb.Text = TotalCost.ToString();
          return;
      }
  </code></pre>
  
  <p>I want to generate or execute event as text box created i do now want to mouse click or text_change.
  And want to display multiplication of two integer inside</p>
  
  <p>how can i do that??</p>