Opening...Closing Forms

G

Guest

The migration from VB6 is anything but easy.

Ok...I have an introductory form (start-up is via sub main) and then several
succeeding forms which gather some info. As soon as the info is gathered
they can be closed for good, Based on the info...I refer to a module which
loads another form and possibly several others. In VB6 as soon as all the
forms had been processed ... the module would send me back to my intro form.

For some reason...I can't get back to this intro form...and it doesn't
appear forms I thought I had closed...actually closed.

I need some help...

Thanks
 
R

RobinS

Is the intro form still open? Or did you close it?

Instead of closing it, you can hide it by setting its [visible] property to
false.
Me.Visible = False
Form2.Show()

Or if you closed it, just re-open it.
MainForm.Show()

If you want to see a list of forms that are still open, try this; you can
stick it in your form_load event and then look in either the Immediate
window or the Output window, depending on your settings:

For each myForm in My.Application.OpenForms
Debug.Print myForm.Name
Next

I used to hide my main form because I used properties on it, then had a
<Close> and an
<Exit> button all the other forms. If they hit <Close>, I closed the current
form and took
them back one level. If they hit <Exit>, I closed all forms and exited the
application.

Does that help at all?

Robin S.
--------------------------------
 

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