Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove eventhandler
Message
 
 
À
16/08/2006 11:09:06
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01145973
Message ID:
01146085
Vues:
18
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform