"Marcel van der Gragt" <marcelASTvandergragtDTnl> schrieb
I'm I correct that you cannot raise events in the New (or
constructor) procedure?
You can raise events in the constructor. The problem is that you have to
1. create the object
2. add event handlers
As "create the object" includes the execution of the constructor, the first
handler can not be added before the constructor has been executed completely.
Consequently, no event handler will be called when the event is raised in
the ctor.
One exception:
1. Pass a delegate to the constructor
2. In the ctor, add the delegate to the event
3. raise the event
But, it's easier to simply invoke the delegate.
--
Armin
http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html