How to check if an event has any handlers?

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,081
Programming Experience
10+
In C# we can do:

if(someObject.EventName == null)
MessageBox.Show(There is no handler associated with the event");


What do we do in VB to see if an event has any handler?
 
Ahhhh.. This is nasty:

if(someObject.EventNameEvent Is Nothing)
MessageBox.Show(There is no handler associated with the event")


VB makes the delegate, always calls it YOUR_EVENT_NAMEEvent and hides it. It's still there and can be accessed just by taking your event name, and adding the word "Event"
 
Back
Top