1

I've started doing some basic win forms work in VB 2010 and I'm really bothered by the default instance feature. Is there a way I can disable it entirely and just use the classes like ordinary classes?

Community
  • 1
  • 1
just.another.programmer
  • 8,579
  • 8
  • 51
  • 90

1 Answers1

0

Add a parameter to the form's constructor. That will prevent the default instance being created. You will need to have a call to InitializeComponent to layout the controls.

Sub New(junk As Object)
    ' This call is required by the designer.
    InitializeComponent()

    ' Add any initialization after the InitializeComponent() call.

End Sub
SSS
  • 4,807
  • 1
  • 23
  • 44