Unimatrix_001
asked on
Emptying an eventhandler
Hi,
I know I can bind an event to a handler as follows:
buttonInstance.Click+=Some EventHandl er
But is there a way to empty the event of all handlers?
Thanks,
Uni
I know I can bind an event to a handler as follows:
buttonInstance.Click+=Some
But is there a way to empty the event of all handlers?
Thanks,
Uni
ASKER
I'm away of being able to do that, but I'm ideally wanting a way to clear it without having to refer to individual event handlers otherwise it means I need to keep track of which ones have been added...
Is it something to do with the multiple buttons you created?
If yes then do the following
foreach(Button button in panel1.Controls)
{
button.Click -= SomeEventHandler;
}
Thx!
Swaps...
If yes then do the following
foreach(Button button in panel1.Controls)
{
button.Click -= SomeEventHandler;
}
Thx!
Swaps...
ASKER
Nah, afraid not... This is something seperate.
Could you give me a sample?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's the ticket. :)
buttonInstance.Click -= SomeEventHandler
Thx!
Swaps