me.close problem

  • Thread starter Thread starter gjnave
  • Start date Start date
G

gjnave

Guest
Lately (it didn't seem to do this before), when i try to open a form from within a form and then close the original form, both forms close and the program shuts down.

Is this a glitch in .Net?

here's the code using two forms (startForm and goForm)

(StartForm)

dim gForm as new goForm
gForm.show
me.close

**
At which point both forms crash. Am I missing something stupid?

thanks
 
My guess is that it's becuase startForm is your startup object and thus your application. It seems to make sense that if that were closed all other forms would also be closed.

On the other hand, if you did opened yet another form from goForm it should behave as you are expecting.
 
quwiltw is correct. Once you stop the message pump of the main window in your application the application will terminate under most circumstances. The easy solution to this is to hide the window instead of closing it.
 
Back
Top