Ok so here is my problem:I have a form with 10 user control (they are all the same) and they each include 1 textbox, 1 combobox and 5 checkbox.
By default everything is disabled, but with another checkbox the user will enabled either the textbox or the combobox or all 5 checkboxes.
I could easly do it by doing something like
ucPlayer1.name.Enabled = true;
ucPlayer2.name.Enabled = true;
etc .. but it seems unnecessary
Before I wasn't using any usercontrol so I could do something like:
foreach (Control c in this.Controls)
{
if (c is TextBox && c != null)
((TextBox)c).Enabled = true;
}
but now, i'm stuck, I can't get a working loop, i tried something like:
foreach(UserControl uc in Controls)
But it doesn't work.
Any ideas ??