Click here to Skip to main content
13,295,441 members (35,543 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Is it possible to show a splash screen as soon as the user attempts to open an app? On XP there is a long wait (the first time I run the app), I assume while dot net loads.
Posted 10-Dec-12 8:44am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

LizHundy 10-Dec-12 14:00pm
I have built a splash screen. It opens before my main form is created, from the Main() method. But first time I run the app there is a long delay before it appears. I thought this might be due to dotnet, but I suppose it could be a virus checker causing the delay.
Jason Gleim 10-Dec-12 14:21pm
When you launch an application, if the .net framework isn't running, it must startup. Then, it must load your application's manifest file and parse it. Then it loads your main assembly, compiles it, and starts running it. If it has to jump to another class it will stop and compile it. Remember that .net apps are JIT compiled on-the-fly from MSIL to the binaries as the app is run.

You can improve initial startup with some tricks like delay-loading assemblies your app relies on but which may not be needed till later and avoiding things like initializing classes outside of a constructor (at the class level) when you declare the object. (declaring private myClass myObject = new myClass(); will initialize and create myObject as soon as the class which contains that call is initialized whereas if you do:
private myClass myObject;
void MyContainingClass()
myObject = new myClass();
The myObject doesn't get explicitly created until the containing class is explicitly created. Which if you do the same thing for the MyContainingClass object, you would put the new MyContainingClass() call after you have displayed the splash screen. Make sense?

Also, are you using the static Main() function as your entry point or is it Form1.Main()? If you use the static one, you have much more control over your application start up. If you use the form-based one, then everything behind your form must initialize before that function is called.
LizHundy 10-Dec-12 15:09pm
Thanks Jason. That is helpful information.
I am using static Main()
Perhaps I need a separate non-dotNet app to show the splash screen and then invoke my dotnet application.
jibesh 10-Dec-12 17:37pm
I dont understand why you are worrying about .net and non .net. Since your main application taken long time to start-up because of several reason not necessarily .Net but may be for various other reason, I would suggest you to start a splash screen and update(write) something on the splash screen to let the user know that system is performing some operation.

There are good number of splash screen samples are available in code project have a look at it. some are
LizHundy 11-Dec-12 4:48am
Hi jibesh. You miss the point. I start the splash screen before my app begins to initialise. But the splash screen does not appear as soon as the user clicks to start the app. On a slow computer running XP there is considerable delay before the splash screen appears. I assume that tihs delay is waiting for .NET to load.
I have a very nice splash screen from Code Project. This is a valuable resource. :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171207.1 | Last Updated 10 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100