I need to move data from textboxes created dynamically from one windows form to another.
The user entered data in textboxes should be displayed as labels in the next windows form.
plz suggest me the code to transfer the data.
textboxes are created using the following code:
private void ButtonOk_Click_1(object sender, EventArgs e)
{
int txtno = int.Parse(TxtNos.Text);
int pointX = 410;
int pointY = 10;
int pointx = 550;
panel2.Controls.Clear();
for (int i = 0; i < txtno; i++)
{
TextBox sub = new TextBox();
TextBox marks = new TextBox();
sub.Text = (i + 1).ToString();
marks.Text = (i + 1).ToString();
sub.Location = new Point(pointX, pointY);
marks.Location = new Point(pointx, pointY);
panel2.Controls.Add(sub);
panel2.Controls.Add(marks);
panel2.Show();
pointY += 30;
}
}
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 30, 2016, 7:56 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Sep 30, 2016, 8:36 PM EDT