I am creating textboxes dynamically. So I want a unique (Name) for every textbox I create, as I want to save the contents of every textbox in a file.
for (int p = 1; p <= 4; p++)
{
string str = "txt" + b + a;
//How so I convert this into textBox form???
TextBox txt = (TextBox)str; //ERROR
a++;
txt = new TextBox();
panel1.Controls.Add(txt);
Please suggest an effective code, Thank you in advance.
Loading
Sam HobbsPosted Mar 22, 2010, 9:33 PM
Note that the code is putting the textboxes in an array, and you can later use the array to get the values from the textboxes.
Lalit MPosted Mar 22, 2010, 4:11 AM
http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_2.0/Q_23847736.html
http://www.infernodevelopment.com/creating-c-average-calculator
http://msdn.microsoft.com/en-us/library/system.windows.forms.binding.aspx