Application.Run without passing first form as argument

  • Thread starter Thread starter Erik Jensen
  • Start date Start date
E

Erik Jensen

I am interested in calling Application.Run() without
passing a first form as the argument to the Run method.
Reason being is that i would like to instantiate some
helper or foundation classes before showing any vestiges
of a form on the screen.

This is how i am trying:
Form1 frm = new Form1();
//form one is empty with a textbox for fun in it
frm.Visible = false;
frm.WindowState = FormWindowState.Minimized;
Application.Run();
HelperClass1 help = new HelperClass1();
help.DoDuties();
frm.Show();

But the form is not showing.

Does anyone know of how to start an application and maybe
not call a form till later.. or hide the form and call
helper classes after. I am interested in not having the
Main method within my first Form's class.

I cant seem to find much in teh way of sample windows
forms applications around in the open source community.


Any Ideas?

Thanks
 
Erik Jensen said:
I am interested in calling Application.Run() without
passing a first form as the argument to the Run method.
Reason being is that i would like to instantiate some
helper or foundation classes before showing any vestiges
of a form on the screen.

This is how i am trying:
Form1 frm = new Form1();
//form one is empty with a textbox for fun in it
frm.Visible = false;
frm.WindowState = FormWindowState.Minimized;
Application.Run();
HelperClass1 help = new HelperClass1();
help.DoDuties();
frm.Show();

But the form is not showing.

Does anyone know of how to start an application and maybe
not call a form till later.. or hide the form and call
helper classes after. I am interested in not having the
Main method within my first Form's class.

I cant seem to find much in teh way of sample windows
forms applications around in the open source community.

Why don't you just make Application.Run your last statement instead of
having it half way down your code?
 
Back
Top