title: How to get Text from Textbox created during runtime
body: <p>I have created WinForm App in which user can set how many textboxes he want (Range 1-99)
  I am using this code to create Textboxes during runtime</p>
  
  <pre><code>  for (int i = 0; i &lt; Calculation.Num; i++)
     {
         TextBox txtRun = new TextBox();
         txtRun.Name = "txtBox" + i;
         txtRun.Location = new System.Drawing.Point(35, 50 + (20 * i) * 2);
         txtRun.Size = new System.Drawing.Size(75, 25);
         this.Controls.Add(txtRun);                
     }
  </code></pre>
  
  <p>Suppose user create 2 textboxes and then enter data in each textbox and click calculate button
  Now i want to <strong>get the textboxes data</strong> and divide it by 100</p>
  
  <p>See The Picture I want txtbox1 and txtbox2 data</p>
  
  <p><img src="https://i.stack.imgur.com/7tjWv.png" alt="enter image description here"></p>
  
  <p><strong>EDIT 3:</strong></p>
  
  <p>This is the Whole Code</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace GPA_Calculatior__New_
  {
      public partial class Form1 : Form
      {
  
          int j = 0;
  
          public Form1()
          {
              InitializeComponent();
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
              //Label + Marks Obtained Textbox
              for (int i = 0; i &lt; Calculation.Num; i++)
              {
                  Label lblCount = new Label();
                  lblCount.Name = "lblCount" + i;
                  lblCount.Location = new System.Drawing.Point(5, 55 + (20 * i) * 2);
                  lblCount.Size = new System.Drawing.Size(20, 30);
                  lblCount.Text = (i + 1).ToString();
                  this.Controls.Add(lblCount);
  
                  TextBox txtRun = new TextBox();
                  txtRun.Name = "txtBox" + i;
                  txtRun.Location = new System.Drawing.Point(35, 50 + (20 * i) * 2);
                  txtRun.Size = new System.Drawing.Size(75, 25);
                  this.Controls.Add(txtRun);   
  
              }
  
              //Creating Textbox which is for total marks
              for (j = 0; j &lt; Calculation.Num; j++)
              {
                  TextBox txtRun = new TextBox();
                  txtRun.Name = "TotaltxtBox" + j;
                  txtRun.Location = new System.Drawing.Point(160, 50 + (20 * j) * 2);
                  txtRun.Size = new System.Drawing.Size(50, 25);
                  txtRun.Text = "100";
                  txtRun.Enabled = false;
                  this.Controls.Add(txtRun);
              }
              // Creating 2 Buttons (Calculate and Back)
              for (int k = 0; k &lt; 2; k++)
              {
                  Button Btn = new Button();
                  Btn.Name = "btn" + k;
                  Btn.Location = new System.Drawing.Point(20 + (k *110), 60 + (20 * j) * 2);
                  Btn.Size = new System.Drawing.Size(90, 30);
  
                  if (k == 0)               
                      Btn.Text = "Back";
  
                  else
                      Btn.Text = "Calculate";
  
                  Btn.Click += button_Click;
  
                  this.Controls.Add(Btn);
              }
  
              //Just for Giving free space in last
  
              Label lbl = new Label();
              lbl.Name = "lbl" + j;
              lbl.Location = new System.Drawing.Point(30, 90 + (20 * j) * 2);
              lbl.Size = new System.Drawing.Size(90, 30);
              lbl.Text = "";
  
              this.Controls.Add(lbl);
              //**********************************************
          }
  
          //Caculate and back button function
          private void button_Click(object sender, EventArgs e)
          {
              Button btn = sender as Button;
              if (btn.Name.Equals("btn1"))
              {
                  for (int i = 0; i &lt; Calculation.Num; i++)
                  {
  
                  }
              }
              else
              {
                  GPA_Calculator mainForm = new GPA_Calculator();
                  mainForm.Show();
                  this.Hide();
              } 
          }
  
  
  
  
          private void checkBox1_CheckedChanged(object sender, EventArgs e)
          {
              for (j = 0; j &lt; 10; j++)
              {
  
              }
          }
  
          private void Form1_FormClosed(object sender, FormClosedEventArgs e)
          {
              Application.Exit();
          }
  
      }
  }
  </code></pre>