I\'d like to add an event to all TextBoxes on my Form:
Form
foreach (Control C in this.Controls) { if (C.GetType() == typeof(System.Windows.Forms
Updated answer:
I needed to disable all the controls in a form, including groupboxes. This code worked:
private void AlterControlsEnable(bool ControlEnabled) { foreach (Control i in Controls) i.Enabled = ControlEnabled; }