How do I get an event to fire as soon as an object's constructor has finished?
问题 Research tells me that raising an event from the constructor itself is not feasible as the object may not be fully initialised... so where can I fire an event from as soon as the constructor has fired? 回答1: One thing you can do is add a method to handle additional post ctor tasks: Friend Class FooBar Public Sub New ' your code here End Sub Public Sub Create ' do anything you want End Sub End Class Elsewhere: Friend WithEvents Foo As Foobar ' ... Foo = New FooBar ' Foo doesnt exist until ctor