Close Form while processing Constructor

  • Thread starter Thread starter Osvaldo Bisignano
  • Start date Start date
O

Osvaldo Bisignano

In the constructor of my form, I check for some conditions and if they don't match I want the form to get closed, or better said, never be shown.
I get an error if I call Me.Close() either in the constructor or in the Form_Load or in the form_activate events.

Is there any other Event or method I could use? I guess it's a very common task to be done, so what's your solution to this?

Thanks in advance
Osvaldo
 
* "Osvaldo Bisignano said:
In the constructor of my form, I check for some conditions and if they don't match I want the form to get closed, or better
said, never be shown.

If the ctor is called, the form isn't shown automatically.
I get an error if I call Me.Close() either in the constructor or in
the Form_Load or in the form_activate events.

Throw an exception in the ctor.
 
Back
Top