Splash Screen Problems

S

Stuart Ferguson

Hi,

I am currently writing a GUI which requires a splash screen in C#, the form
itself has a Graphic (Inside a picture box) and 2 labels on it, when i show
it using the following the form soesnt display right.....
The splash screen loading even which contains this code is being fired bfore
the load event of the MDI Form, i dont know if that is what is causing the
problem

frmSplash frmSplash;
frmSplash = new frmSplash();
frmSplash.Show();
Thread.Sleep(2500); // two and half seconds splash screen will be displayed.
frmSplash.Close();
Activate();

Many Thanks in advance
Stuart Ferguson
 
F

Frank Eller [MVP]

Hi Stuart,
I am currently writing a GUI which requires a splash screen in C#,
the form itself has a Graphic (Inside a picture box) and 2 labels on
it, when i show it using the following the form soesnt display
right.....
The splash screen loading even which contains this code is being
fired bfore the load event of the MDI Form, i dont know if that is
what is causing the problem

Splash-Screen is usually loaded before the Application.Run()-Call (in the
Main()-Method of your Application). You should probably Insert an
Application.DoEvents() - call before sending the thread to sleep ...

=================
FrmSplash frm = new FrmSplash();
frm.Show();
Application.DoEvents();
Thread.Sleep(2500);
frm.Close();

Application.Run( new Form1() );
=================

Regards,

Frank Eller
 
S

Stuart Ferguson

Cheers M8 that fixed my problem

:)

Stuart

Frank Eller said:
Hi Stuart,


Splash-Screen is usually loaded before the Application.Run()-Call (in the
Main()-Method of your Application). You should probably Insert an
Application.DoEvents() - call before sending the thread to sleep ...

=================
FrmSplash frm = new FrmSplash();
frm.Show();
Application.DoEvents();
Thread.Sleep(2500);
frm.Close();

Application.Run( new Form1() );
=================

Regards,

Frank Eller
 

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