In my program i have 50 text boxes with the name TB1 to TB50
I am trying to use a for loop to change the content of them all with a few lines of code. Instead of repeating the code 50 times. However i cant get this to work. Any help would be greatly appreciated (Please see what where i got ot below)
private void Button_Click(object sender, RoutedEventArgs e)
{
for (int i =1; i < 50; i++)
{
string TB = "TB" + i;
TextBox TBN = new TextBox();
TBN.Name = TB;
TBN.Text = "Textbox Changed";
}