Hi Nadav,
Application.Exit() terminates the application.
One suggestion to handle the scenario you describe is to throw an exception
in
your form's constructor, then trap that exception in your app's
Main() entry point method.
If an exception is thrown, do not call Application.Run() to run the
message loop and just return from Main() without loading the form.
Regards,
Aravind C
"Nadav" <No*@Today.maybe.tommorow> wrote in message
news:Oz**************@TK2MSFTNGP09.phx.gbl...
Hi,
I am writing Forms application, at certain situations I need to
prematurely close it, e.g. upon invalid initialization the App should be closed, using
...Form.Close from the forms constructor doesn't help, I wonder... Is
there an equivalent to the C++ PostQuitMessage(0) in C#? What is it?
ThanX
Nadav.