I am new to c# as am a php / js / html developer. I have 8 switches named relay_1,relay_2,relay_3 etc etc I need to be able to change the state of these but I would like to do through a for loop so the number is dynamic. I have tried various methods but to no avail. Any help would be greatly appreciated. This is what I would like ( not correct )
for (int i = 0; i < 8; i++)
{
relay_" + i.IsChecked = true;
}