Remove and later re-add all event handlers associated with a groupbox in C# winforms -
is there way collection of handlers associated groupbox in c# winforms?
for cases checked statuses need changed programatically (not user), need turn off handlers other parts of program not fire. tedious hand many handlers.
is there working code version of pseudocode not work below?
foreach(control c in parent.groupbox1.controls) { c.disablehandlers() } //change controls handlers have interfered foreach(control c in parent.groupbox1.controls) { c.enablehandlers() }
it possible use crazy reflection code this, don't want because you'll invariably run "well still want keep event not others".
i recommend making class contains list of add-listener delegates , list of remove-listener delegates, , iterate through , execute each delegate @ appropriate times.