Best way to end and application in VB.NET

G

Guest

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?
 
S

Sean Hederman

mcsdguru said:
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.
 
C

Cor Ligthert

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
 
G

Guest

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.
 
G

Guest

Or even Application.Exit

Cor Ligthert said:
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
 
C

Cor Ligthert

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
 

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

Top