j2associates

Hello all,

We just recently converted from 1.1 to 2.0. In 1.1 I could overload a form's constructor something like the following:

Public Sub New(ByVal myArgument As String)
MyClass.New
' Do something.
End Sub 'New

Where do I do this in 2.0



Re: Windows Forms General Overloading a Form's constructor in VS2005

j2associates

Public Sub New(ByVal myArgument As String)
    MyClass.New
    ' Do something.
End Sub 'New

The default New constructor is not emitted in 2.0. However, it does show up in the Declarations for either form or form.Designer Declarations. When I attempted to do an overload and reference MyClass in code similar to the above, it gave me a couple errors. One was that I needed to call InitializeComponent and the second was that MyClass was not defined.

When I clicked on New in either the form or form.Designer Declarations, the default New constructor was emitted and then my code as above compiled cleanly.