Closing my application

andycharger

Well-known member
Joined
Apr 2, 2003
Messages
152
I need to close my application.
In VB6 you used to be able just to shut the main form down and it would "kill" the application

ie, we just type
Code:
form1.close

However, I tried this in .net and it leaves the process going, despite the application dissapearing form screen.

What is the correct syteax in .net for exiting an exe and killing the process?

Thanks

Andy
 
Try using:

Code:
Application.exit


This is the equivalent to using end in VB6. It wasnt the greatest thing to use, but it worked.

Im not aware of any problems with using .exit in .net.
 
If all forms are closed and all non-background threads have exited cleanly (no resources left open etc.) Then closing down the main form should also close the application.
Do you have any hidden forms still open? Any threads running?

Application.Exit has pretty much the same result as end in VB6 - not all cleanup code gets called etc.
 
Back
Top