App.Exit

  • Thread starter Thread starter PCH
  • Start date Start date
P

PCH

I have a class that is loaded from the main form. And if certain req's are
met, it needs to close the entire program. I am using the Application.Exit
command, but it seems to ignore it! it keeps executing other code after its
been called.

Is there any way to force the program to close down?
 
You can't guarantee that no other code wil be executed after a call to
App.Exit. The best way to stop the app is to close its main form - App.Exit
is sort of an emergency approach. You may want to set some global flag, to
indicate that the app is terminating, and based on it not to continue
certain operations.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top