Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2006

Tip: Looking for answers? Try searching our database.

Correct way to exit an Winform application?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sune42@hotmail.com - 29 Jun 2006 09:35 GMT
What is the "Correct" way to exit an Winform application?

I have used

Application.Exit();

But I find that the application is still running in TaskManager after
closing it,
so I asume that I am doing something wrong here..

Any ideas?
Herfried K. Wagner [MVP] - 29 Jun 2006 11:24 GMT
<sune42@hotmail.com> schrieb:
> What is the "Correct" way to exit an Winform application?

Call the main form's 'Close' method.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>

Aristotelis Pitaridis - 29 Jun 2006 15:12 GMT
I use the End command in order to exit my applications.

Aristotelis

> What is the "Correct" way to exit an Winform application?
>
[quoted text clipped - 7 lines]
>
> Any ideas?
Stoitcho Goutsev (100) - 30 Jun 2006 14:45 GMT
Windows processes are removed from memory when there is no more runing
threads in them. If you have worker threads make sure that they have
finished before closing the application. Alternatively when you start a
thread you can set IsBackground property to *true* so the the threads will
be killed upon exiting the application; otherwise they will keep working,
thus locking the process in the memory.

The normal way of exiting an application is to stop all worker threads as
well as all UI threads. The UI threads are stopped when the main form's
Close method is called (this ends to message loop). I personally never liked
this Application.Exit. It looked to me too brutal. However I see that in
.NET 2.0 they made it more polite :), so now it looks OK to be used.

Signature

Stoitcho Goutsev (100)

> What is the "Correct" way to exit an Winform application?
>
[quoted text clipped - 7 lines]
>
> Any ideas?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.