Take the 2-minute tour ×

When starting my app I at first have to read in some data, have to init some forms and so on. For that time the user sees just grey getting-ready to show something forms.

This lasts for a few seconds...

I thought of a Splash Screen that loads the data in a seperate Thread and also shows how long it will take. Or just a status bar?

How would you do something like this?

I'm using C# .NET 3.5 + Winforms

share|improve this question
Suuuubjeeeective.... –  Filip Ekberg Aug 20 '09 at 11:58
@Filip: Why is "how do I implement a splash screen in WinForms?" subjective? –  RichieHindle Aug 20 '09 at 12:01
the question title should probably be changed to reflect your @RichieHindle's comment, then it wouldn't look so subjective –  Rich Seller Aug 20 '09 at 12:04
You could always take the flash game approach and present the user with a mini-pong game to keep them occupied while your data loads. Probably not the best idea for business environments, though. –  Jason Z Aug 20 '09 at 12:25
@Rich: Good point - done. Shame the question already has five tags, so I can't add my new subjective-if-I-don't-actually-read-the-question tag. 8-) –  RichieHindle Aug 20 '09 at 12:27
add comment

4 Answers

up vote 2 down vote accepted

With WindowsForm, the easier is to use Backgroundworker.

You can disables controls during loading and display a progress bar on startus bar with label as "loading data...".

MSDN link : http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx

share|improve this answer
add comment

See this CodeProject article: A Pretty Good Splash Screen in C#

It implements a splash screen that:

  • Runs on a separate thread
  • Fades in as it appears, and fade out as it disappears
  • Displays a running status message that is updated using a static method
  • Displays and update a predictive self-calibrating owner-drawn smooth-gradient progress bar
  • Displays the number of seconds remaining before load is complete

Here's an example of what it looks like - maybe yours will be prettier. 8-)

alt text

share|improve this answer
I had a look at that one before but it's not that good - he uses DoEvents() instead of a real thread and he does some not thread-save actions that are no longer allowed in .NET 3.5 –  Kai Aug 20 '09 at 12:08
@Kai: Are you sure? I see this: ms_oThread = new Thread( new ThreadStart(SplashScreen.ShowForm)); which certainly looks like a real thread to me. And no mention of DoEvents. –  RichieHindle Aug 20 '09 at 12:11
@Kai: Im evaluating the same article Richie has pointed out. Scroll down to view one of the comments by Mahin Gupta who has recently re-written some of the code for .net3.5 compatibility, including some thread-safe issues. –  Shalan Sep 3 '09 at 10:51
add comment

If it only lasts a few seconds then displaying the wait cursor should be fine. Perhaps it can be arranged that the main window is shown as quickly as possible and the rest is started after the first screen update (e.g. using a timer). This will reduce the perceived start-up time.

In order to reduce the startup time you may also consider postponing some of startup actions if they are not strictly necessary. It can be done later in the background using a timer or on-demand.

share|improve this answer
add comment

I recently wrote a similar splash screen using Tom Clements as a basis. Take a look at My Splash Screen to see if it fits your needs.

share|improve this answer
add comment

Your Answer


