Click here to Skip to main content
15,881,803 members
Articles / Desktop Programming / WPF

WPF Splash Screen

Rate me:
Please Sign up or sign in to vote.
4.50/5 (7 votes)
13 May 2009CPOL2 min read 43.4K   13   5
Now, WPF applications can have a simple splash screen for free.

One thing that many people write for their programs is a small dialog that loads up when you start your application. Sometimes this is just an image file, and other times, it might show you the progress of the app loading, or even something else. Well now, WPF applications can have a simple splash screen for free. This only applies to WPF since I tested it with Forms and it did not work at all. Well, on to the coding....

Add an image to your project. I added simple.png to my little test app. From there, look at the properties of the image and it will say that the image is a resource. Just change the build action to be SplashScreen and you are done.

There are some down sides with this way of doing a splash screen. You do not get to control it. If you want to have a progress bar or to programmatically change the version number, you cannot do it. OK, I will say that there is no immediate way to do it. I am sure that one of the many smart people out there will be able to do it someday.

The second thing is that it is setup to fade out in 0.5 seconds by default. There is no property on the image to allow you to change this. To make it more customizable, you will have to set the image back to a resource, and then in your App class, create an instance of a ScreenSaver class. From this, you can set the time to do the fading and the image resource to use. This gives you more flexibility, but still no handle to the dialog.

This should be simple enough for anyone to recreate it. If you want my sample project, just let me know.

This is a nice small start for WPF to get this type of feature. I like the new things that keep coming out for WPF, and can't wait for VS2010 to be completed and released.

This article was originally posted at http://www.strugglingthru.net/rss.xml

License

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


Written By
Software Developer (Senior) InfernoRed Technologies
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 2 Pin
Marco Bertschi5-Nov-12 23:38
protectorMarco Bertschi5-Nov-12 23:38 
QuestionPlease Pin
Таньо Тодоров Иванов7-Jul-12 3:53
Таньо Тодоров Иванов7-Jul-12 3:53 
Suggestionregarding screen saver Pin
nareshbammidi1-Aug-11 0:56
nareshbammidi1-Aug-11 0:56 
hi,
i want to develop aquarium screen saver using wpf.
how to start the project.
please give me the suggestion regarding this
Generalhi Pin
Kiran Kumar Koyelada12-Jul-09 18:22
Kiran Kumar Koyelada12-Jul-09 18:22 
GeneralRe: hi Pin
Steve Maier13-Jul-09 7:20
professionalSteve Maier13-Jul-09 7:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.