SplashScreen Class
This page is specific to:.NET Framework Version:3.54.0
.NET Framework Class Library
SplashScreen Class

Updated: July 2008

Provides a startup screen for a Windows Presentation Foundation (WPF) application.

Namespace:  System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)
Syntax

'Usage

Dim instance As SplashScreen

'Declaration

<UIPermissionAttribute(SecurityAction.LinkDemand, Window := UIPermissionWindow.AllWindows)> _
Public Class SplashScreen
You cannot directly create an instance of this class in XAML.
Remarks

Use the SplashScreen class to show an image in a startup window, or splash screen, when a WPF application starts. Call the Show method to display the splash screen. Call the Close method to close the splash screen. Specify the image to use in the SplashScreen constructor.

The SplashScreen class can display any image format that is supported by the Windows Imaging Component (WIC). For example, you can use the BMP, GIF, JPEG, PNG, or TIFF format. If the image is a PNG file and it includes an alpha channel, the image is rendered using the transparency defined in the alpha channel.

You cannot include placeholder text in the splash screen that is later added by your code. If you want to include text in the splash screen, you must add it to the image file.

NoteNote:

It is not necessary to write any code to display a splash screen. Starting in Visual Studio 2008 SP1, you can quickly configure a splash screen with default settings. For more information, see How to: Add a Splash Screen to a WPF Application.

The SplashScreen class displays the splash screen as soon as possible after the application is started. The splash screen is displayed by using native code, before the WPF application instance is created. The splash screen is displayed in the center of the screen. When the application is loaded, the splash screen fades.

When your application is compiled, the image is embedded as a managed resource in the assembly. If the application is localized, the image is embedded in the localized satellite DLL.

NoteNote:

The SplashScreen class is not available in partial trust.

NoteNote:

The SplashScreen class cannot be used in XAML Browser Applications (XBAPs), because they use a different startup architecture.

Examples

The following code example shows how to create and display a startup window by using the SplashScreen class.

SplashScreen splashScreen = new SplashScreen("SplashScreenImage.bmp");
splashScreen.Show(true);

// Run the application.


.NET Framework Security

Inheritance Hierarchy

System..::.Object
  System.Windows..::.SplashScreen
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5 SP1, 3.0 SP2
See Also

Reference

Other Resources

Change History

Date

History

Reason

July 2008

Added topic for new class.

SP1 feature change.

Community Content

Be careful using this from code in 3.5 SP1
Added by:JosephCooney
See bug 378575 on connect: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=378575&wa=wsignin1.0

You may see strange Win32Exceptions raised if you try and programatically close the splash screen.
© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View