Hi,

I already have an application built and have thought about adding a splashscreen to it.

My initial form is MainForm.cs
my splashscreen is Splash.cs

I have searched the net and seen various different approaches to displaying the splashscreen and have only had limited success with one that I found.
This particular approach used Threading and was supposed to display the splash for 3secs and then sleep for 1sec before starting the main form. For some reason though it displayed the splash then after about 3secs the main form loaded below it and the splash screen stayed on top.

I have also found another example on this forum here, although when I ran the source code from the zip file it worked perfectly , I implemented all the changes onto my own project and all that happened was that the splashscreen and the main form started at the same time.

All I want is for my splash to display for a few seconds then fade out and load the main form.

Any help would be greatly appreciated.

Regards..,

MT

>All I want is for my splash to display for a few seconds then fade out and load the main form.

Timer Or Thread. Take a look at - http://msdn.microsoft.com/en-us/library/aa446493.aspx

Hi,

thanks for replying.

Here is what I am using at the moment:-

public MainForm()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			Thread t1 = new Thread(new ThreadStart(Splash));
            t1.Start();
            Thread.Sleep(3000); // 3 seconds
            t1.Abort();
            Thread.Sleep(1000);
			
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
		}
		
		private void Splash()
        {
            Splash newSplash = new Splash();
            newSplash.ShowDialog();
            newSplash.Dispose();
        }

I have just actually figured out why the splashscreen seems to be sticking even when the mainform opens.
I have my splashscreen set to StartPostion: CenterScreen, which is also the same for the mainform.

I just changed the splashscreen startpos to windowsdefault and it works brilliantly, as it should.

Problem is though, that I really do want my splash to be centered and I also want my mainform to be centered when it starts.

I am guessing that there needs to be some screen redraw or something to clear the splash off before the mainform loads.

Whether this all makes sense.

Regards..,

MT

After a little bit more fiddling I have managed I think to solve this.

The mainform TopMost was set to False, I have changed this to True and it seems to have done the trick.

Regards..,

MT

I'm glad you got it working. Please mark this thread as solved if you have found an answer to your question and good luck!

This question has already been answered. Start a new discussion instead.