Best way to end and application in VB.NET

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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
 
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.
 
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
 
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
 
Back
Top