how to create text box when we click the button and at a time only create one text box and again i click button for create one more text box
it is like button is '+' once we click '+' create one text box and there is no limit is there and similarly how to give different name s to each one

Raja TRank #685 · 3.5K reputationPosted Jan 11, 2016, 9:45 PM EST
{
int txtno = int.Parse(txt1.Text);
int pointX = 30;
int pointY = 40;
panel2.Controls.Clear();
for (int i = 0; i < txtno; i++)
{
TextBox a = new TextBox();
a.Text = (i + 1).ToString();
a.Location = new Point(pointX, pointY);
panel2.Controls.Add(a);
panel2.Show();
pointY += 20;
}
}
catch (Exception)
{
MessageBox.Show(e.ToString());
}
Rajeesh MenothRank #118 · 18.4K reputationPosted Jan 11, 2016, 9:45 PM EST
Ankur MistryRank #86 · 23.9K reputationPosted Jan 11, 2016, 10:29 PM EST