Skip to main content

SplashScreenManager.Invalidate() Method

Forces the splash form to be redisplayed.

Namespace: DevExpress.XtraSplashScreen

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public void Invalidate()

Remarks

Example

In this example, an image is displayed as a splash screen via the SplashScreenManager.ShowImage method.Custom information is painted over this image via a custom class (SplashImagePainter), whose instance is passed as a parameter to the ShowImage method. The SplashImagePainter draws text labels with custom progress information.

View Example

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraSplashScreen;

namespace SplashScreenManagerSample01 {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
            LongInitialization();
        }
        protected void LongInitialization() {
            BaseInitialization();
            LoadFonts();
            LoadTextures();
        }

        void BaseInitialization() {
            // Set progress stage to be displayed by SplashImagePainter
            SplashImagePainter.Painter.ViewInfo.Stage = "Initialization";
            for(int i = 1; i <= 100; i++) {
                System.Threading.Thread.Sleep(20);

                // Change progress to be displayed by SplashImagePainter
                SplashImagePainter.Painter.ViewInfo.Counter = i;
                //Force SplashImagePainter to repaint information
                SplashScreenManager.Default.Invalidate();
            }
        }
        void LoadFonts() {
            // Set progress stage to be displayed by SplashImagePainter
            SplashImagePainter.Painter.ViewInfo.Stage = "Loading Fonts";
            for(int i = 1; i <= 100; i++) {
                System.Threading.Thread.Sleep(20);

                // Change progress to be displayed by SplashImagePainter
                SplashImagePainter.Painter.ViewInfo.Counter = i;
                //Force SplashImagePainter to repaint information
                SplashScreenManager.Default.Invalidate();
            }
        }
        void LoadTextures() {
            // Set progress stage to be displayed by SplashImagePainter
            SplashImagePainter.Painter.ViewInfo.Stage = "Loading Textures";
            for(int i = 1; i <= 100; i++) {
                System.Threading.Thread.Sleep(20);

                // Change progress to be displayed by SplashImagePainter
                SplashImagePainter.Painter.ViewInfo.Counter = i;
                //Force SplashImagePainter to repaint information
                SplashScreenManager.Default.Invalidate();
            }
        }
        //

        protected override void OnLoad(EventArgs e) {
            base.OnLoad(e);
            // Close splash image
            SplashScreenManager.HideImage();
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Invalidate() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also