namespace WindowsFormsApplication1 { public partial class Form1 : Form { private List<textbox> inputTextBoxes; public Form1() { InitializeComponent(); this.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.AutoSize = true; this.Padding = new Padding(0, 0, 20, 20); this.StartPosition = FormStartPosition.CenterScreen; } private void btnadd_Click(object sender, EventArgs e) { int inputNumber = Int32.Parse(textBox1.Text); inputTextBoxes = new List<textbox>(); inputTextBoxes = new List<textbox>(); for (int i = 1; i <= inputNumber; i++) { Label labelInput = new Label(); TextBox textBoxNewInput = new TextBox(); labelInput.Text = " " + i; labelInput.Location = new Point(30, textBox1.Bottom + (i * 30)); labelInput.AutoSize = true; textBoxNewInput.Location = new Point(labelInput.Width, labelInput.Top - 3); inputTextBoxes.Add(textBoxNewInput); this.Controls.Add(labelInput); this.Controls.Add(textBoxNewInput); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)