E
exclaim
Can someone confirm that I have got the right idea about Events in VB.Net?
I know it is possible to set up custom events with custom eventarg
classes and use AddHandler to receive them - I have used this
successfully in the past. If I read the manuals correctly though, you
don't have to do this - simply declaring an object WithEvents, declaring
an event within the object code, raising the event within the object
code and making sure there is a Sub with the same signature in the
calling module which Handles the object's event is sufficient.
If this is so, why can't I get it to work? I can step through the
(successfully compiled) code and see the RaiseEvent line being executed,
but I never see the Handler sub entered.
Is there something else I need to do? Does anyone have a known working
example of a really simple event mechanism? All suggestions welcome...
Regards
--Jim.
I know it is possible to set up custom events with custom eventarg
classes and use AddHandler to receive them - I have used this
successfully in the past. If I read the manuals correctly though, you
don't have to do this - simply declaring an object WithEvents, declaring
an event within the object code, raising the event within the object
code and making sure there is a Sub with the same signature in the
calling module which Handles the object's event is sufficient.
If this is so, why can't I get it to work? I can step through the
(successfully compiled) code and see the RaiseEvent line being executed,
but I never see the Handler sub entered.
Is there something else I need to do? Does anyone have a known working
example of a really simple event mechanism? All suggestions welcome...
Regards
--Jim.
