Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB AddHandler --> C# equiv.
Message
De
20/07/2004 21:02:48
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
VB AddHandler --> C# equiv.
Divers
Thread ID:
00926398
Message ID:
00926398
Vues:
82
Hello all,

What is the equivalent in C# for the following VB.NET statements? o is a TextBox object passed into the method:
AddHandler o.Validating, New System.ComponentModel.CancelEventHandler(AddressOf OnValidating)
Answering #1 certainly answers this one, so I only need comments if you feel its necessary:
RemoveHandler o.Validating, New System.ComponentModel.CancelEventHandler(AddressOf OnValidating)
And finally:
RaiseEvent ValidationError(tb, New System.EventArgs())
I'm trying something like the following to do #1 and #2:
System.ComponentModel.EventHandlerList oEvents = new
		System.ComponentModel.EventHandlerList();
oEvents.AddHandler(o.Validating, new System.ComponentModel.CancelEventHandler(OnValidating));
Thanks for your help, I really appreciate it...
Steve Gibson
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform