- 3 minutes to read
The WaitForm is a small splash form that contains an animated image and two labels (by default). This form can be used to indicate the progress of operations during your application run. The creation and management of Wait Forms is performed by the Splash Screen Manager component. Below is the default appearance of the Wait Form painted using the DevExpress Style skin.
An animated image, displayed within the Wait Form, is obtained from the current skin. Here are examples of Wait Forms painted in different skins.
The Wait Form's image, caption and description are internally encapsulated by a built-in ProgressPanel control. This control can be accessed at design time (using the Wait Form's designer), at which time you can change the caption and description to custom values, modify the control's appearance and layout settings, etc. The following image illustrates some useful properties.
Displaying Wait Form
Unlike a SplashScreen, the automatic display of a Wait Form at the start of a main form is not supported. You can display and close a Wait Form manually using the following methods.
If the Splash Screen Manager's Active Splash Form (see SplashScreenManager.ActiveSplashFormTypeInfo) is set to the Wait Form that needs to be displayed, use non-static SplashScreenManager.ShowWaitForm and SplashScreenManager.CloseWaitForm methods.
splashScreenManager1.ShowWaitForm(); //... splashScreenManager1.CloseWaitForm();
If the Splash Screen Manager's Active Splash Form is not set to the Wait Form that needs to be displayed, use the static SplashScreenManager.ShowForm and SplashScreenManager.CloseForm methods. The SplashScreenManager.ShowForm method has several overloads that allow you to enable/disable a splash form's fade-in and fade-out effects.
Wait Forms and Splash Screens are displayed by a Splash Screen Manager in a separate thread. So, changing splash form labels and all other appearance settings directly at runtime is not safe or even possible, since you do not have access to an instance of the splash form currently displayed. You can dynamically update any splash form setting by using the command mechanism, supported by the SplashScreenManager.SendCommand and SplashFormBase.ProcessCommand methods.
Two methods help you dynamically change a Wait Form's caption and description while the form is being displayed at runtime: SplashScreenManager.SetWaitFormCaption and SplashScreenManager.SetWaitFormDescription.
If you need to display multiple Wait Forms simultaneously, use the multiple Splash Screen Manager components.
Displaying a Wait Form within an MDI child Form's Load event handler may lead to the application freezing. Instead, you can display a Wait Form within an MDI child Form's Shown event handler.
Do not use the OnControlCreated method overload to display a Wait Form.