I have a form which contains several standard controls (textbox's, buttons, etc). I want to group certain controls in collections so that I can enable and disable them at any given time without having to explicitly set each one. What is the syntax to do that? Here is some pseudo code to show what I want to do....
Control[] ControlCollection = new Control[];
ControlCollection.add(Button1);
ControlCollection.add(TextBox1);
...
...
foreach( Control x in ControlCollection)
{
x.Enabled = false;
}
I know i could put the controls in say a group box and accomplish this but the controls are not positioned on the form in such a manner that it is convenient to do so.