6

I am actually studying and working on VB.NET. My school is using VS2010, and I professionally use VS2012. When I have to call a windows form in an Mdicontainer in VS2010, I just use its class name, like for example:

FormX.MdiParent = Me

FormX.Show()

But when i use VS2012, it seems I have to create an instance of my mdichild, just like this:

Dim form As New FormX()

form.MdiParent = Me

form.Show()

My question is: is it just me doing wrong or VS has changed the way we use WinForms?

SSS
  • 4,807
  • 1
  • 23
  • 44
Yonn Trimoreau
  • 539
  • 7
  • 23

1 Answers1

1

VS2012 VB.NET does have default instances, just like in VS2010. Most likely you have defined a custom Sub New() with a parameter list, e.g. Sub New(a As Integer). When this is the case no default instance is generated, you need to explicitly create the form.

SSS
  • 4,807
  • 1
  • 23
  • 44