Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Dynamically Update Wait Form's Caption or Description

  • 2 minutes to read

A Wait Form is displayed by a Splash Screen Manager in a separate thread. To dynamically change labels within the Wait Form, while it is being displayed, use the SplashScreenManager.SetWaitFormCaption and SetWaitFormDescription methods.

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;
using System.Threading;

namespace WaitForm_SetDescription {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        private void btnShowWaitForm_Click(object sender, EventArgs e) {
            //Open Wait Form
            SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);

            //The Wait Form is opened in a separate thread. To change its Description, use the SetWaitFormDescription method.
            for (int i = 1; i <= 100; i++) {
                SplashScreenManager.Default.SetWaitFormDescription(i.ToString() + "%");
                Thread.Sleep(25);
            }

            //Close Wait Form
            SplashScreenManager.CloseForm(false);
        }
    }
}