Naive question about closing a WinForm

  • Thread starter Thread starter Water Cooler v2
  • Start date Start date
W

Water Cooler v2

If I have only one main form in my WinForms app, do I also need to
call Application.Exit() after this.Close() or will just the call to
Close() suffice?
 
Water Cooler v2 said:
If I have only one main form in my WinForms app, do I also need to
call Application.Exit() after this.Close() or will just the call to
Close() suffice?

If you have only one form, you probably are opening that form with
Application.Run(theForm), in the Main() method in Progam.cs. When you do
this, the application terminates when theForm is closed. Therefore, in this
case, you don't need Application.Exit.
 
If you have only one form, you probably are opening that form with
Application.Run(theForm), in the Main() method in Progam.cs. When you do
this, the application terminates when theForm is closed. Therefore, in this
case, you don't need Application.Exit.


Thanks very much.
 

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

Similar Threads

A question about a gridView 3
Application.Exit 2
Ending a program while in Form_Load 10
handling dialog box 4
C# WinForms Objects 2
Reusing closed Winforms 11
Disposable & 3rd Party Lib & GUI 3
Main window location 4

Back
Top