Windows Develop Bookmark and Share   
 index > Windows Forms General > Closing application?
 

Closing application?

I am wondering how Application.Exit, Me.Dispose and End are different when it comes to closing an application (File --> Exit menu)

Which one should I use?

Thanks 
MigrationUser 1  Tuesday, April 26, 2005 8:32 PM
Normally I dispose then Application.Exit().  Might not be the best practice, but that's what I like.  :)

Once you close the app, the most important things is to release the memory you collected while running.  One form with all it's disposable objects disposed is really not worth counting ticks over, so just be sure to clear your ado.net objects and threads, and you'll be in good shape.
MigrationUser 1  Tuesday, April 26, 2005 8:58 PM
What if I use Me.Dispose, wouldn't that dispose all the resources?
MigrationUser 1  Tuesday, April 26, 2005 10:11 PM
No.  me.Dispose only disposes the form's components.  You need to explicitly destroy your other objects that are hefty.  
MigrationUser 1  Wednesday, April 27, 2005 12:03 AM

You can use google to search for other answers

Custom Search

More Threads

• saving to a jpg and changing the compression ratio
• ListView control ... Problem??
• Want an Form event like Form1_Loaded not Form1_Load
• How can I get the Datetimepicker's selected part
• DataGridViewRows problem
• Selecting item before ComboBox is displayed
• DataGridView key events and DataGridViewComboxBox manual entered values
• User Control Event Handling
• Order of groups in a listview
• Getting Control in Main Window