Click here to Skip to main content
15,887,366 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Sometimes when my the form is closed the application is still running. I noticed this behaviour when using the msgbox function.

I have no thread nor timer running, so what the problem??? I am using VB.NET.

Thanks
Posted
Updated 16-Aug-13 3:33am
v2
Comments
Sergey Alexandrovich Kryukov 16-Aug-13 9:38am    
Not enough information, sorry.
Are your talking about main form, when you say it's closed? Can you reproduce it in a simple one-file code sample?
—SA

1 solution

What do you mean you noticed this behaviour when using the msgbox function? Can you show us the code you are talking about? We can't help you find what is still running without seeing your code. Also, does your project have just one form? Or several?

Click on My Project in the solution explorer and click on the Application tab, what do you have set for Shutdown mode? If you have "When startup form closes" and you have multiple forms, the problem could be that you haven't actually closed the startup form of your project. If you have "When last form closes" then perhaps you have hidden a form but not closed it entirely and that's why it's still running.

If changing those settings and/or making sure that all forms are closed doesn't work, you could always use
Application.Exit()[^]
to get the entire application to shutdown.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900