Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create a custom eventHandler?
Message
De
29/08/2007 00:48:42
 
 
À
28/08/2007 22:28:30
Czarina Joyce Villanueva
Innovision Systems International
Manila, Philippines
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01251064
Message ID:
01251072
Vues:
15
Try this:
public event EventHandler MyControlDidThis;

protected virtual void OnMyControlDidThis(EventArgs e)
{
    if (this.MyControlDidThis != null)
        this.MyControlDidThis(this, e);
}

// when you need to fire this event in the class:
this.OnMyControlDidThis(new EventArgs());
~~Bonnie





>Guys!
>
>I just want to know if it is possible to create Custom Event Handler? Any idea? I tried:
>
>this.CustomEvent += new System.EventHandler(myControl_CustomEvent);
>
>private void myControl_CustomEvent()
>{
>}
>
>
>Above is not working...
>
>TIA
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform