Is it possible to use an array of textfields, buttons and other elements in C#?
I have, say 25 text fields, and instead of naming them txt1, txt2, and so on, I would like to use something of the form, txt[i=1,25].
I remember using something like subscripts in VB 6.0.
If not possible, is there any other way to do the same?
The above snippet will add 10 textboxes to your collection, each with their own ID.
You can do the same thing with arrays ofcourse, but Lists are more flexible in my opinion.
Instead of making a List of Textboxes, you could also just make a list of Controls.
Something like:
List<Control> x = new List<Control>();