x***@y.com
2016-08-25 06:04:23 UTC
I want to add controls to a panel dynamically.
So normally:
TextBox textBox1 = new TextBox();
panel1.Controls.Add(textBox1);
But what if I know the control type as a string?
Like:
string controlType = "TextBox"; //or "Label" etc.
How can I create a control dynamically from the type given as string?
So normally:
TextBox textBox1 = new TextBox();
panel1.Controls.Add(textBox1);
But what if I know the control type as a string?
Like:
string controlType = "TextBox"; //or "Label" etc.
How can I create a control dynamically from the type given as string?