473,409 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

The "Correct" way to close an application

I've heard this both ways so I'm wondering, is using the:

Me.Dispose ()

....method in VB.NET the best way to close down an application? Is
there a cleaner way to do it? I've heard grumblings that this isn't
always the best way. Is it a catch all disposal of objects, or could
some stay after the dispose?

-Joe

Nov 20 '05 #1
4 1779
* Joe Kimbler <jo*@z100online.com> scripsit:
I've heard this both ways so I'm wondering, is using the:

Me.Dispose ()

...method in VB.NET the best way to close down an application? Is
there a cleaner way to do it? I've heard grumblings that this isn't
always the best way. Is it a catch all disposal of objects, or could
some stay after the dispose?


I would use 'Me.Close()' instead of calling the dispose method. If all
windows/the message pump is closed, the application will terminate.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
What about "Application.Exit()"? For example, if you have an MDI form with
three MDIChildren open inside it and you choose "Exit" from a menu in your
MDI form...

LB.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bp*************@ID-208219.news.uni-berlin.de...
* Joe Kimbler <jo*@z100online.com> scripsit:
I've heard this both ways so I'm wondering, is using the:

Me.Dispose ()

...method in VB.NET the best way to close down an application? Is
there a cleaner way to do it? I've heard grumblings that this isn't
always the best way. Is it a catch all disposal of objects, or could
some stay after the dispose?


I would use 'Me.Close()' instead of calling the dispose method. If all
windows/the message pump is closed, the application will terminate.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
"Lester Botello" <le*****@hotmail.com> schrieb
What about "Application.Exit()"? For example, if you have an MDI form
with three MDIChildren open inside it and you choose "Exit" from a
menu in your MDI form...


Call the close method of the MDI form. The children are closed
automatically.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
* "Lester Botello" <le*****@hotmail.com> scripsit:
What about "Application.Exit()"? For example, if you have an MDI form with
three MDIChildren open inside it and you choose "Exit" from a menu in your
MDI form...


Did you read the documentation for 'Application.Exit'?

<msdn>
CAUTION The Form.Closed and Form.Closing events are not raised when
the Application.Exit method is called to exit your application. If you
have validation code in either of these events that must be executed,
you should call the Form.Close method for each open form individually
before calling the Exit method.
</msdn>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

53
by: Alf P. Steinbach | last post by:
So, I got the itch to write something more... I apologize for not doing more on the attempted "Correct C++ Tutorial" earlier, but there were reasons. This is an UNFINISHED and RAW document,...
6
by: Rob Meade | last post by:
Hi all, Ok - I've used the word gramatically - which I'm sure is incorect, however I mean when VS2005 lists "warnings" like this one: Warning 1 Variable 'Command' is used before it has been...
3
by: Mitchell Vincent | last post by:
I've been somewhat confused about what the "proper" place is to store data files (like file based databases) for my applications. With all the different "special" folders available, which is the...
50
by: Shadow Lynx | last post by:
Consider this simple HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head>...
4
by: metaperl | last post by:
I work at a place which is currently running SQL 2000, but they are planning to migrate to 2k5. I was thinking that this is the perfect opportunity to fix all the weaknesses we have had in our data...
4
by: chaitu | last post by:
Hi guys, I've written a parallel build program (in Perl) that takes a pre-computed dependency tree of many projects in 2 visual studio .net 2003 solution (.sln) files here at my company, and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.