andycharger Posted June 30, 2003 Posted June 30, 2003 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 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 Quote
jspencer Posted June 30, 2003 Posted June 30, 2003 Try using: Application.exit This is the equivalent to using 'end' in VB6. It wasn't the greatest thing to use, but it worked. I'm not aware of any problems with using .exit in .net. Quote
Administrators PlausiblyDamp Posted June 30, 2003 Administrators Posted June 30, 2003 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.