P
Paschalis Pagonidis
Hi all,
I've created a splash screen for an MDI application and
moved the main application's entry function in the splash
screen's class.
Inside the Main(), I run the following:
[STAThread] static void Main ()
{
Application.Run (new FormSplash ());
}
In the Load event of FormSplash, I start a timer that
increases the form's Opacity value and updates a progress
bar and a label.
Finally, I start another thread to run the MDI form and
close the splashscreen:
private void FormSplash_Load (object sender,
System.EventArgs e)
{
timer_Refresh.Start();
...
... // connect to db, initialize some static
objects etc...
...
// Run main MDI application
Thread thread = new Thread (new ThreadStart
(FormMain.Start));
thread.IsBackground = false;
thread.Start();
this.Close()
}
The problem is that even if timer is enabled, it doesn't
get into the Tick event's implementation, until the splash
form is being closed with Close().
Any suggestions? Is there a simpler way to have a splash
screen created and shown before the main application's
form?
Thanks in advance,
Pascal
I've created a splash screen for an MDI application and
moved the main application's entry function in the splash
screen's class.
Inside the Main(), I run the following:
[STAThread] static void Main ()
{
Application.Run (new FormSplash ());
}
In the Load event of FormSplash, I start a timer that
increases the form's Opacity value and updates a progress
bar and a label.
Finally, I start another thread to run the MDI form and
close the splashscreen:
private void FormSplash_Load (object sender,
System.EventArgs e)
{
timer_Refresh.Start();
...
... // connect to db, initialize some static
objects etc...
...
// Run main MDI application
Thread thread = new Thread (new ThreadStart
(FormMain.Start));
thread.IsBackground = false;
thread.Start();
this.Close()
}
The problem is that even if timer is enabled, it doesn't
get into the Tick event's implementation, until the splash
form is being closed with Close().
Any suggestions? Is there a simpler way to have a splash
screen created and shown before the main application's
form?
Thanks in advance,
Pascal