J
Jay B. Harlow [MVP - Outlook]
David,
instance or static, and their handlers can be instance or static. Events
really don't care either way, raising an Event simply calls all the handlers
(delegates) that have been registered with it...
all the handlers that are currently registered with it.
Delegates really don't know any thing about windows or pumps.
either instance methods or static methods, the event (more importantly the
underlying delegate) doesn't care what kind of method it (the delegate) is
associated with. Which IMHO is one of the truly cool & powerful features of
..NET events over COM & VB6 events!
I would expect the same result (as I described & Craig perceived) even if
LaunchFormB was called within a Form because of a Button Click event. In
fact that is the way I understand that Craig is calling it.
Hope this helps
Jay
Application.ThreadException is a static event! Remember events can beI believe he is having this problem because he subscribed to the
ThreadException from a static method (main) and not from an instance method
in FormA.
instance or static, and their handlers can be instance or static. Events
really don't care either way, raising an Event simply calls all the handlers
(delegates) that have been registered with it...
Again Application.ThreadException is a static event, it is "delivered" toAt the time he subscribed there was no window at all in the system, so
perhaps the Forms class is getting confused about where to deliver the
event to.
all the handlers that are currently registered with it.
I'm really not sure why! The event (any event) is implemented as a Delegate,if there was no window or pump running at the time the event was
subscribed to it may getting confused
Delegates really don't know any thing about windows or pumps.
Events don't expect instances, events expect handlers, these handlers can beit may be expecting an instance and there is none associated with the
event.
either instance methods or static methods, the event (more importantly the
underlying delegate) doesn't care what kind of method it (the delegate) is
associated with. Which IMHO is one of the truly cool & powerful features of
..NET events over COM & VB6 events!
I would expect the same result (as I described & Craig perceived) even if
LaunchFormB was called within a Form because of a Button Click event. In
fact that is the way I understand that Craig is calling it.
Hope this helps
Jay