I am creating several text boxes depending on user choice (1-5).How can I access value of programmatic textbox when text changes.
class starts{
int i=0;
.....
TextBox txtb4 = new TextBox();
txtb4.Name = "textname" + Convert.ToString(i);
ArrayText.Add(txtb4);
System.Drawing.Point p5 = new System.Drawing.Point(120, 15);
txtb4.Location = p5;
txtb4.Size = new System.Drawing.Size(80, 30);
txtb4.Text = stringMy;
grBox1.Controls.Add(txtb4);
i++;
}
I can access initial textbox text using code below, but I can't access it after value is changed.
label15.Text = grBox1.Controls["textname0"].Text;