Connecting Tech Pros Worldwide Forums | Help | Site Map

Exiting an Application in VB.net

tt
Guest
 
Posts: n/a
#1: Nov 20 '05
Hi,
ANy ideas on this? When I click the close button of a
window in VB.net which method gets called?

I used Applicaton.exit in some method of my appln. to
exit the application but, it still leaves the process in
the process table. Can someone help me exiting an
application cleanly.
Thanks
-tt

Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 20 '05

re: Exiting an Application in VB.net


Hello,

"tt" <t@t.com> schrieb:[color=blue]
> ANy ideas on this? When I click the close button of a
> window in VB.net which method gets called?[/color]

The handler for the form's 'Closing' event.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet


Armin Zingler
Guest
 
Posts: n/a
#3: Nov 20 '05

re: Exiting an Application in VB.net


"tt" <t@t.com> schrieb[color=blue]
> Hi,
> ANy ideas on this? When I click the close button of a
> window in VB.net which method gets called?
>
> I used Applicaton.exit in some method of my appln. to
> exit the application but, it still leaves the process in
> the process table. Can someone help me exiting an
> application cleanly.
> Thanks
> -tt[/color]

To exit the app, all threads must be exited. Do you have multiple threads? A
UI thread exits when you exit the message loop. If you've passed a Form to
Application.Run you must close the Form to exit Application.Run. If you
didn't passed a Form, call Application.ExitThred (not Exit).

If you can reproduce the problem in the IDE, go into break mode, look at the
threads window and the callstack.


--
Armin


Closed Thread