Home » VB.Net

VB.net Application not exiting completely

Hi, the application I am developing does not exit completely. i.e. the process can be seen in the Task manager. This happens only when I click on the [X] button on the title bar of the window of my MDI form. If I use the File >> Exit in the menu of my application, it exits without leaving any traces. I have used the "End" method there. But the process stays when I click the [X] on the control box on the title bar.

Thanks in advance,



5 Answers Found


Answer 1

Never use the End method. 

It kills an application, giving it no chance to clean up.

Simply use for the close the close and nothing more.

(The x button does that automatically)


Answer 2


what i think is that if u just click [x] button, it only causes the form onload, and it won't make the application stop.

what to do is u can try use Application.exit() method

here is a link regarding the application exit issues, may be u wanna read it


hope it is useful for u.


Answer 3


To use the application exit is only a good idea if you have started your program with Application.Run, both application Run and Application.Exit are done in most windows programs by the application framework, so it is seldom a good idea to use that.

Despite that some do.



Answer 4


There is a Shutdown mode in the properties of application in VS

Right click your project name->Properties->Application tab->Shutdown mode

two options for u to choose:

1. when startup form closes

2. when last form closes

Choose one base on the specific requirement.


Answer 5


Thanks for your reminding. It does make sense.

Best Regards,




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure