SplashScreenManager.SendCommand(Enum, Object) Method
Sends a command to the currently active splash form.
Namespace: DevExpress.XtraSplashScreen
Assembly: DevExpress.XtraEditors.v19.2.dll
Declaration
public void SendCommand(
Enum cmd,
object arg
)
Public Sub SendCommand(
cmd As Enum,
arg As Object
)
Parameters
Name | Type | Description |
---|---|---|
cmd | Enum | An enumeration value that identifies the command to be sent to the currently active splash form. |
arg | Object | The command's parameter. |
Remarks
A splash form is displayed in a separate thread. To interact with a splash form via code, you can send commands to it via the SendCommand method. To respond to the commands, override the SplashFormBase.ProcessCommand method for your splash form and implement the required functionality.
Examples
In this example a custom Progress Bar Control is added to a Splash Screen. The example shows how to update this Progress Bar Control dynamically by sending commands from a Splash Screen Manager.Splash Screens are displayed by a Splash Screen Manager in a separate thread. Interaction with Splash Screens can be performed via the command mechanism. You send a command via the SplashScreenManager.SendCommand method and process this command by overriding the SplashScreen.ProcessCommand method. In the example, custom commands are sent to the Splash Screen to advance the progress of the Splash Screen's Progress Bar Control.
NOTE
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-interact-with-a-splash-screen-by-sending-commands-e3576
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraSplashScreen;
namespace SplashScreen_ProcessCommand {
public partial class SplashScreen1 : SplashScreen {
public SplashScreen1() {
InitializeComponent();
}
#region Overrides
public override void ProcessCommand(Enum cmd, object arg) {
base.ProcessCommand(cmd, arg);
SplashScreenCommand command = (SplashScreenCommand)cmd;
if (command == SplashScreenCommand.SetProgress) {
int pos = (int)arg;
progressBarControl1.Position = pos;
}
}
#endregion
public enum SplashScreenCommand {
SetProgress,
Command2,
Command3
}
}
}