I want to create a TextBox dynamically in form and retrieve its data and paste it into another TextBox in the same form when I click a button.
I used the following code for creating texboxes dynamically :
public int c=0;
private void button1_Click(object sender, EventArgs e)
{
string n = c.ToString();
txtRun.Name = "textname" + n;
txtRun.Location = new System.Drawing.Point(10, 20 + (10 * c));
txtRun.Size = new System.Drawing.Size(200, 25);
this.Controls.Add(txtRun);
}
I need the code for retrieving data from this TextBox
txtRun? How are you creatingtxtRunbtw?