I can't remember what keyword is needed to force people to call the parent's New. Any help would be appreciated!
Printable View
I can't remember what keyword is needed to force people to call the parent's New. Any help would be appreciated!
Or am I just crazy and there is nothing out there that does this? :)
Um, in the child class constructor, it would be mybase.new....
-tg
If the base class has no default constuctor (parameterless) then the subclass is required to call the parameterized constructor.
Well, this is what I'm asking. My base class has a Sub New(), and I have code in it that I want to run no matter what class inherits it. Now, I know the child class can call MyBase.New() in its constructor, but VB.NET doesn't force this. Is there a way to force the child class to always call MyBase.New() when it inherits from that base class?
Nevermind... It looks like MyBase.New() automatically gets called due to the Inherits keyword. I guess programmers don't need to explicitly call that function in order for it to run. :)
I dunno... when ever I create a new form, I always see a MyBase.New() called in there.... even though it Inherits Windows.Form.....
-tg
Well, I think C# requires that, but VB.NET doesn't. Of course, I'm also using VB .Net 2005 August CTP...