title: how to delete dynamic textbox created in c#
body: <pre><code>TextBox[] txt = new TextBox[4];
  for (int i = 0; i &lt; 5; i++)
  {
      txt[i] = new TextBox();
      txt[i].Text = "button" + i;
  }
  </code></pre>
  
  <p>these are the codes to create dynamic textbox. i don't know how to delete these button. later i found  how to this textboxes this may help you in your project
  this is the functin to delete the text box completly.</p>
  
  <pre><code>private void CleanForm(Control ctrl)
      {
          foreach (Control c in ctrl.Controls)
          {
              if (c is TextBox)
              {
                  ((TextBox)c).Dispose();
                  CleanForm(this);
              }
  
          }
      }
  </code></pre>