Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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.

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...