Simple Question -- Switching Forms

  • Thread starter Thread starter A. Gaubatz
  • Start date Start date
A

A. Gaubatz

I switched from VB6 to VB.net some time ago, and I cannot figure out how
to close FormA and open FormB.

I have 2 forms "Main" and "Start". To switch it should just be:

Me.Hide
Start.Show

However, this does not work. It says that "reference to a non-shared
member requires and object reference"

Thanks,
 
You need to create an instance of "Start", as Start is a class of form, not
an instance of one,

Try this:

Dim theStart as New Start

Start.Show ()
Me.Hide ()
 
Robin Tucker said:
You need to create an instance of "Start", as Start is a class of form,
not an instance of one,

Try this:

Dim theStart as New Start

Start.Show ()
Me.Hide ()

one of the best features of VB.NET if you ask me.
 
Back
Top