Application.Exit

V

vul

I start the application with Application.Run(New MDIMain) in Sub Main.
MDIMain is the mdi form which loads and then calls Login form.
I'm using Application.Exit to terminate my VB 2005 application on Login
screen if user clicks on Cancel button.
When I do this I get a sound as MessageBox produces. I do not see any
messages, but VB environment works abnormally after that. It doesn't switch
modules until I minimize it and maximize again or close solution and open
again. I suspect that there is a problem with Application.Exit.
What is a good approach to terminate the application?

Thank you
Al
 
H

Herfried K. Wagner [MVP]

vul said:
I start the application with Application.Run(New MDIMain) in Sub Main.
MDIMain is the mdi form which loads and then calls Login form.
I'm using Application.Exit to terminate my VB 2005 application on Login
screen if user clicks on Cancel button.
When I do this I get a sound as MessageBox produces. I do not see any
messages, but VB environment works abnormally after that. It doesn't
switch modules until I minimize it and maximize again or close solution
and open again. I suspect that there is a problem with Application.Exit.
What is a good approach to terminate the application?

Try closing the application's main form by calling its 'Close' method.
 
V

vul

I added Me.Close in Login form before Application.Exit.
Now there is no messagebox like sound and no problem with VS environment
after stopping the application, but there is a delay for about 5-6 seconds
in VS environment. The application disappears from the screen without any
delay, but the button stop in VS environment remains enable for those 5-6
seconds. When I run compiled exe I do not see any problem (maybe it's
hidden)

Thank you
Al
 
M

Mythran

vul said:
I added Me.Close in Login form before Application.Exit.
Now there is no messagebox like sound and no problem with VS environment
after stopping the application, but there is a delay for about 5-6 seconds
in VS environment. The application disappears from the screen without any
delay, but the button stop in VS environment remains enable for those 5-6
seconds. When I run compiled exe I do not see any problem (maybe it's
hidden)

Thank you
Al
Herfried K. Wagner said:
Try closing the application's main form by calling its 'Close' method.

Are you connected to a database or something and haven't closed/disposed the
connection yet?

Mythran
 

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