Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove eventhandler
Message
 
 
To
16/08/2006 11:09:06
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01145973
Message ID:
01146085
Views:
17
Kewl! I would not have guessed that one in a hundred years.


>Einar,
>
>This will do the trick:
>
>this.button1.Click -= new System.EventHandler(this.button1_Click);
>
>
>~~Bonnie
>
>
>>How do I remove the event? Considder this:
>>
>>this.button1.Click += new System.EventHandler(this.button1_Click);
>>
>>Now I want to prevent the method button1_Click to fire and I thought I could use System.EventHandler.Remove(...) or System.EventHandler.RemoveAll(...), but I can't find any examples on how to use them. I can't figure out what the arguments are.
>>
>>I could also add code to the button1_Click method to prevent the code from running but I think removing the event would be cleaner.
>>
>>Any thoughts.
>>
>>Thanks,
>>Einar
Previous
Reply
Map
View

Click here to load this message in the networking platform