Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB AddHandler --> C# equiv.
Message
From
20/07/2004 21:02:48
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
VB AddHandler --> C# equiv.
Miscellaneous
Thread ID:
00926398
Message ID:
00926398
Views:
81
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
Next
Reply
Map
View

Click here to load this message in the networking platform