System.Environment.Exit

  • Thread starter Thread starter roberti
  • Start date Start date
R

roberti

Hi all,

I am creating an application timeout function, and I have some
problems. When the timeout fires, i am suposed to close the
application and don´t ask nothing to user about validating and
closing eventhandlers messages.

If i use the Application.Exit method, these events don´t fire. But, if
there is some error message before the timeout fire, it persists
after the timeout (whe using application.exit) and the application
doesn´t close.

If i use the mdi.close method, the children closing events fire and
the user recives many messages asking him to close all the forms.

I have tried using System.Environment.Exit(0), and i think it is
working very well... but i have never read something about using this
method on this class to close an application. I would like to ask you
about this... if someone has some problem using this method, an
so...

thanks for you help me!

regards.

Waldemar Roberti
 
* (e-mail address removed)-dot-br.no-spam.invalid (roberti) scripsit:
I am creating an application timeout function, and I have some
problems. When the timeout fires, i am suposed to close the
application and don´t ask nothing to user about validating and
closing eventhandlers messages.

Remove the event handlers using 'RemoveHandler', then call the main
form's 'Close' event to exit the message loop.
 
Back
Top