Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Collapse]Task-Based Help
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]Actions
  [Expand]Navigation
  [Expand]Views
  [Expand]List Editors
  [Expand]Property Editors
  [Expand]Templates
  [Expand]Filtering
  [Expand]Reporting
  [Expand]Dashboards
  [Expand]Scheduler and Notifications
  [Expand]Maps
  [Expand]Security
  [Expand]Workflow
  [Expand]Localization
  [Expand]Testing
  [Collapse]Miscellaneous UI Customizations
    How to: Add a Button to a Detail View Using Custom View Item
    How to: Add an XAF Mobile Custom Module
    How to: Adjust the Size and Style of Pop-up Dialogs (ASP.NET)
    How to: Adjust the Windows' Size and Style
    How to: Change an Application Logo and Info
    How to: Create a Custom Control Detail Item
    How to: Customize a Window Caption
    How to: Customize ASP.NET Layout Elements Using Custom CSS Classes
    How to: Customize Export Options of the Printing System
    How to: Customize the Conditional Appearance Module Behavior
    How to: Customize Window Status Messages
    How to: Enable High DPI Support in a WinForms Application
    How to: Implement a Custom Messaging Class
    How to: Include an Action to a Detail View Layout
    How to: Raise XAF Callbacks from Client-Side Events and Process these Callbacks on Server
    How to: Set Images and Captions for Enumeration Values
    How to: Show a Custom Window with an Embedded XAF View
    How to: Show a Custom Windows Form
    How to: Use a Custom Splash Screen
    How to: Use a DevExtreme Chart in a Mobile Application
    How to: Use Custom Plugins in Mobile Applications
    How to: Use Custom Themes in ASP.NET Applications
  Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Use a Custom Splash Screen

This topic demonstrates how to replace the default splash screen with a custom splash screen. You can either specify a static image, use the Splash Screen Manager component, or design a custom Windows Form. These three approaches are described below. In addition, how to localize your splash screen is described.

Expanded Specify a Static Image

Add an image file to the Windows Forms application project and set its Build Action property to Embedded Resource. Then, open the Program.cs (Program.vb) file and add the following code to specify an image.

The WinApplication.SplashScreen property should be initialized before the WinApplication.Start method is called.

Note

When a BMP image is passed, the transparency is enabled for it using the Bitmap.MakeTransparent method. If the result of this conversion does not match your requirements, manually convert your BMP file to one of the formats with transparency support (e.g., to PNG).

Expanded Use the Splash Screen or Wait Form

To add the Splash Screen or Wait Form, create a custom splash form using the Splash Screen or Progress Indicator template from the DXperience v17.2 Template Gallery project item. Then, open the Program.cs (Program.vb) file and add the following code.

In this example, SplashScreen1 is the name of your splash screen.

Important

EasyTest does not support the DXSplashScreen. If you use EasyTest, disable DXSplashScreen for the EASYTEST solution configuration using the #if and #endif directives.

You can also use the built-in DXSplashScreenForm instead of designing a custom splash screen. In this instance, use the default constructor of the DXSplashScreen class.

The following image illustrates the DXSplashScreenForm splash screen.

Expanded Design a Custom Windows Form

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4646.

You can create a custom Windows Form and use it as a splash screen. An instance of a class implementing the ISplash interface should be assigned to the WinApplication.SplashScreen property for this purpose. The following steps detail this process.

  1. Design a Form for the Splash Screen

    Create a form that will represent the splash screen (right-click the project and choose Add | Windows Form). Design it as you like - add text labels, pictures, etc. A sample design is illustrated below.

  2. Implement the ISplash Interface

    Add a class that will be assigned to the WinApplication's SplashScreen property described above. This class should implement the ISplash interface, which exposes the following members.

    • ISplash.Start
      In this method override, create an instance of the SplashScreenForm and invoke its Show method.
    • ISplash.Stop
      In this method override, hide and close the SplashScreenForm.
    • ISplash.IsStarted
      This property must indicate whether or not the splash screen is being displayed.
    • ISplash.SetDisplayText
      In this method, do nothing, since it is used to set the custom display text in the splash screen form shown by the default splash screen.

    The following snippet illustrates the MySplash class implementation.

  3. Specify the WinApplication's SplashScreen Property

    Open the Program.cs (Program.vb) file located in the Windows Forms application project. In the Main method, create an instance of the MySplash class and assign it to the WinApplication's SplashScreen property.

  4. Implement the ISupportUpdateSplash Interface (Optional)

    If you want to display loading progress information dynamically, implement the ISupportUpdateSplash interface in the MySplash class and add the UpdateInfo method to the SplashScreenForm form.

  5. The following image shows the result.

Expanded Splash Screen Localization

You cannot localize the splash screen using the standard XAF approach because the Application Model is not yet initialized at the moment a splash form is displayed. Instead, use one of the following approaches.

  • If your splash screen supports the ISplash interface, call the ISplash.SetDisplayText method before the application is started to change the text.

  • If you use DXSplashScreen, override the WinApplication.UpdateStatus method. To determine the current context, compare the context parameter with one of the ApplicationStatusMesssageId enumeration values.

How would you rate this topic?​​​​​​​