Monday, November 28, 2011

How to Create a Simple Splash Screen in WPF

I have posted on this topic before, but I thought I would re-post with a step by step tutorial for those who are very new to wpf. Sorry to those of you who are more veterans. I will post more advanced topics soon, but this one’s for the newbies.

Here goes…

WPF makes creating a splash screen fairly simple. All you need to do is embed an image file into your project and change the Build Action on it.

Here is a step-by-step tutorial on how to do this.

Step 1) Create your application.
Here is the xaml for my very complicated application:


Step 2) Add an image file to your application. PNG files with transparent backgrounds are supported and are often a good choice for splash screens. Here is the image I created in Photoshop… nice huh?


Step 3) Right click on the image file in the solution explorer and click on Properties


Step 4) Set the Build Action to SplashScreen in the Properties panel


Step 5) Build and run the application.


You should now see your image splash before the application is loaded. I managed to get a screenshot as the splash screen was fading out and my application was starting to fade in.


That’s all there is to it. It is very simple. There are other ways to show and hide your splashcreen in code, but I won’t get into that in this post. I just wanted to keep it simple for those of you new to SplashScreens in wpf. Happy Splash Screening!

No comments:

Post a Comment