in your main:
MyMainForm hostInterface;
static void Main( )
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
hostInterface = new HostInterface();
// do some stuff to get the form ready
// here you can optionally instance a splash screen
MySplashScreen splash;
hostInterface.Load += splash.Close(); // <- might not be 100% accurate
splash = new MySplashScreen();
Application.Run(hostInterface);
}
See how that works for you. The difference is that you are instantiating the form prior to running anything. I threw in an option for instancing a splash screen.
Compare the above to the standard auto-generated code:
static void Main( )
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MyMainForm());
}
Even without adding a splash screen, I have found that declaring the MyMainForm myform = new MyMainForm()
has been better at loading all the controls prior to Application.Run(new MyMainForm())