
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.43 KB | hits: 13 | expires: Never
Creating Windows Form controls during execution
TextBox textBox = new TextBox();
textBox.Location = Some Point on your form or container.
this.Controls.Add(textBox);
int topValue = 0;
for (int i = 0; i < numericUpDown1.Value; i++) {
TextBox textbox = new TextBox();
textBox.Location = new Point(0, topValue);
this.Controls.Add(textBox);
topValue += textBox.Height + 2;
}
numericUpDown1.Maximum = int.Parse(textBox1.Text);