I am using VB.NET 2008. I have created two forms, Form1 and Form2. A
button on Form1 opens Form2. Although the way that I am doing this is
very unexpected. I always assumed you would have to create an object
and instantiate it, like this:

Dim aForm2 As New Form2()

And then show it like this:

aForm2.Show() or aForm2.ShowDialog()

Instead what I have found is that I can just call Show() and ShowDialog
() like they were static members of Form2

I have this code and it compiles and runs without error:

Form2.Show()

That code allows me to open Form2 within Form1 without create an
object and instantiating it first. Does anyone know why this is the
case and if .NET does some special form stuff that allows me to do it.

Thanks for the help.

Dan

Reply via email to