I need to create an array of shortcuts and text fields dynamically.
I have a groupBox and I need to add to it above. What is the best way to align correctly? How do you get a seat?
below does not work
public void TestCreateInputLabelAndTextBox() { foreach (Parameter parameter in Params) { var lbl = new Label(); lbl.Name = "lbl" + parameter.Name; lbl.Text = parameter.Name; lbl.AutoSize = true; lbl.Location = new Point(7, 30); lbl.Name = "label1"; lbl.Size = new Size(35, 13); var txtBox = new TextBox(); txtBox.Name = "txt" + parameter.Name; txtBox.Text = parameter.Name; txtBox.Location = new Point(20, 20); txtBox.Location = new Point(49, 22); txtBox.Size = new Size(100, 20); groupBox1.Controls.Add(lbl); groupBox1.Controls.Add(txtBox); } }
How do you do this?
user9969
source share