Simple Question -- Switching Forms

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,
 
R

Robin Tucker

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 ()
 
R

Rick Mogstad

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top