Splash screen?

  • Thread starter Paschalis Pagonidis
  • Start date
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
 
P

Paschalis Pagonidis

Yes, I've seen it but the splash screen opens after main
form. I'll give it a 2nd try, by hiding the main form and
showning it just after the splash closes...

thanks for your reply,
Pascal
-----Original Message-----
here's a working sample:

http://www.codeproject.com/csharp/PrettyGoodSplashScreen.a sp

WM_HOPETHISHELPS
thomas woelfer
http://www.die.de/blog



"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


.
 
P

Paschalis Pagonidis

There is another clever way to make splash screen
described in this article:

http://www.c-sharpcorner.com/Code/2004/Jan/Use%
20ApplicationContextClass.asp

-----Original Message-----
here's a working sample:

http://www.codeproject.com/csharp/PrettyGoodSplashScreen.a sp

WM_HOPETHISHELPS
thomas woelfer
http://www.die.de/blog



"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


.
 
T

thomas woelfer

all you need to do is open the splash before you call
Application.Run().

WM_FYI
thomas woelfer
http://www.die.de/blog



Paschalis Pagonidis said:
Yes, I've seen it but the splash screen opens after main
form. I'll give it a 2nd try, by hiding the main form and
showning it just after the splash closes...

thanks for your reply,
Pascal
-----Original Message-----
here's a working sample:

http://www.codeproject.com/csharp/PrettyGoodSplashScreen.a sp

WM_HOPETHISHELPS
thomas woelfer
http://www.die.de/blog



"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


.
 
P

Paschalis Pagonidis

Unfortunately thas is not possible, because Load event of
MDI form interacts with splash. I could remove that code
outside the MDI, but then I'd have to deal with other
issues (make all non-static vars into static etc.)

However, hide/show of main form played well anyway...
Pascal

-----Original Message-----
all you need to do is open the splash before you call
Application.Run().

WM_FYI
thomas woelfer
http://www.die.de/blog



"Paschalis Pagonidis"
Yes, I've seen it but the splash screen opens after main
form. I'll give it a 2nd try, by hiding the main form and
showning it just after the splash closes...

thanks for your reply,
Pascal
-----Original Message-----
here's a working sample:

http://www.codeproject.com/csharp/PrettyGoodSplashScreen
..a
sp
WM_HOPETHISHELPS
thomas woelfer
http://www.die.de/blog



"Paschalis Pagonidis"
Newsbeitrag news:04cd01c5344e$be970970 [email protected]...
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


.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top