469,281 Members | 2,489 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,281 developers. It's quick & easy.

Best way to end and application in VB.NET

When a user clicks File exit in a VB.NET application.........

What would be the best way to end the application after the normal cleanup
stuff specific to the application?
Jul 21 '05 #1
6 24466
"mcsdguru" <mc******@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
When a user clicks File exit in a VB.NET application.........

What would be the best way to end the application after the normal cleanup
stuff specific to the application?


Closing the form that was opened by Application.Run should do it.
Jul 21 '05 #2
> What would be the best way to end the application after the normal cleanup
stuff specific to the application?

What normal cleanup stuff?

With a (normal) ShowDialog form
me.dispose

With a (normal) Show form
me.close

Every non modal form implements Idisposable.

Therefore that would be enough.

Cor
Jul 21 '05 #3
By normal cleanup I mean.....Making sure the application does not end
abruptly and that all the loose ends are tied prior to exiting the
application.

I mean should I use Dispose, Close or End to close out the application after
all processing is completed?

Thanks.

"Cor Ligthert" wrote:
What would be the best way to end the application after the normal cleanup
stuff specific to the application?

What normal cleanup stuff?

With a (normal) ShowDialog form
me.dispose

With a (normal) Show form
me.close

Every non modal form implements Idisposable.

Therefore that would be enough.

Cor

Jul 21 '05 #4
Or even Application.Exit

"Cor Ligthert" wrote:
What would be the best way to end the application after the normal cleanup
stuff specific to the application?

What normal cleanup stuff?

With a (normal) ShowDialog form
me.dispose

With a (normal) Show form
me.close

Every non modal form implements Idisposable.

Therefore that would be enough.

Cor

Jul 21 '05 #5
mcsdguru,

Depends normally your program itself is just me.close in VBNet when it is
not done by the user clicking on the x. button.

Not me.dispose that is not used from inside an object itself.

And never End, that is not clossing your application however killing your
application.

That is all.

Cor
Jul 21 '05 #6
application.exit is the best way to end a VB.NET application

"mcsdguru" wrote:
Or even Application.Exit

"Cor Ligthert" wrote:
What would be the best way to end the application after the normal cleanup
stuff specific to the application?

What normal cleanup stuff?

With a (normal) ShowDialog form
me.dispose

With a (normal) Show form
me.close

Every non modal form implements Idisposable.

Therefore that would be enough.

Cor

Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

136 posts views Thread by Matt Kruse | last post: by
12 posts views Thread by neodem | last post: by
2 posts views Thread by robert | last post: by
4 posts views Thread by =?Utf-8?B?VzFsZDBuZTc0?= | last post: by
12 posts views Thread by MrQuan | last post: by
7 posts views Thread by Ashutosh Bhawasinka | last post: by
reply views Thread by Carl G | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.