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 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Midhun TpPosted Oct 1, 2016, 12:36 AM
Delpin Susai RajPosted Sep 30, 2016, 11:56 AM