M
MuZZy
Hi,
Is there a way to remove all event handlers for a control's event? Say, i have a button and i want
to remove all button.Click events for it - i don't know how many of them was hooked to the event and
what are the functions hooked, but i need to make sure that i unwired all of them at once.
I could unwire event handlers if i knew the functions:
button.Click += new EventHandler(OnMyBtnClick); // Wire event handler
....
button.Click -= new EventHandler(OnMyBtnClick); // Unwire event handler
But again, i don't know which/how many event handlers are wired to the event.
Any ideas/comments would be highly appreciated!
Thank you
Andrey
Is there a way to remove all event handlers for a control's event? Say, i have a button and i want
to remove all button.Click events for it - i don't know how many of them was hooked to the event and
what are the functions hooked, but i need to make sure that i unwired all of them at once.
I could unwire event handlers if i knew the functions:
button.Click += new EventHandler(OnMyBtnClick); // Wire event handler
....
button.Click -= new EventHandler(OnMyBtnClick); // Unwire event handler
But again, i don't know which/how many event handlers are wired to the event.
Any ideas/comments would be highly appreciated!
Thank you
Andrey