Maybe I just don\'t know .NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in .NET (assume this code is on a form with
Make a generic list of textboxes:
var textBoxes = new List();
// Create 10 textboxes in the collection
for (int i = 0; i < 10; i++)
{
var textBox = new TextBox();
textBox.Text = "Textbox " + i;
textBoxes.Add(textBox);
}
// Loop through and set new values on textboxes in collection
for (int i = 0; i < textBoxes.Count; i++)
{
textBoxes[i].Text = "New value " + i;
// or like this
var textBox = textBoxes[i];
textBox.Text = "New val " + i;
}