I have over 40 controls (TextBox, RadioButton, CheckBoxes, etc.) on Windows Forms. Each control is registered for EventHandlers (TextChanged, CheckChanged, etc.).
I want to prevent these events from firing during initialization of the form.
Unsubscribing all events before initialization and subscribing later is laborious.
Which is the best way to achieve this?
You could enumerate all controls like:
And use sources from the article How to remove all event handlers from a control to disable handlers for selected control.