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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With