Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The situation you describe is pretty fishy. Whenever you close your program's startup form, the entire application should quit automatically, including closing <em>all other</em> open forms. Make sure that you're closing the correct form, and you should not experience any problems.</p> <p>The other possibility is that you've changed your project (using its Properties page) not to close until <em>all</em> open windows have been closed. In this mode, your application will not exit until the <em>last</em> remaining open form has been closed. If you've chosen this setting, you have to make sure that you call the <code>Close</code> method of <em>all</em> forms that you've shown during the course of application, not just the startup/main form.</p> <p>The first setting is the default for a reason, and if you've changed it, you probably want to go fix it back.<br> It is by far the most intuitive model for normal applications, and it prevents exactly the situation you describe. For it to work properly, make sure that you have specified your <em>main</em> form as the "Startup form" (rather than a splash screen or log-in form).</p> <p>The settings I'm talking about are highlighted here:</p> <p>&nbsp;&nbsp;&nbsp;<img src="https://i.stack.imgur.com/ZFyew.png" alt="Visual Studio Project Properties"></p> <p>But primarily, note that <strong>you should never have to call <code>Application.Exit</code> in a properly-designed application</strong>. If you find yourself having to do this in order for your program to close completely, then you are doing something wrong. Doing it is not a bad practice in itself, as long as you have a good reason. The other two answers fail to explain that, and thus I feel are incomplete at best.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload