C# 在SplashScreen标签c上显示数据处理#
屏幕已经完成,我使用了Devexpress SplashScreen。它在开始时打开,在加载所有数据时关闭,直到主应用程序打开。现在我的问题是如何将后台加载的数据放到标签中,以便用户看到发生的事情。检查应用程序和启动屏幕之间的通信 表格代码C# 在SplashScreen标签c上显示数据处理#,c#,splash-screen,C#,Splash Screen,屏幕已经完成,我使用了Devexpress SplashScreen。它在开始时打开,在加载所有数据时关闭,直到主应用程序打开。现在我的问题是如何将后台加载的数据放到标签中,以便用户看到发生的事情。检查应用程序和启动屏幕之间的通信 表格代码 private void btnShowSplashScreen_Click(object sender, EventArgs e) { // Open a Splash Screen Spla
private void btnShowSplashScreen_Click(object sender, EventArgs e) {
// Open a Splash Screen
SplashScreenManager.ShowForm(this, typeof(SplashScreen1), true, true, false);
// The splash screen will be opened in a separate thread. To interact with it, use the SendCommand method.
for (int i = 1; i <= 100; i++) {
SplashScreenManager.Default.SendCommand(SplashScreen1.SplashScreenCommand.SetProgress, i);
//To process commands, override the SplashScreen.ProcessCommand method.
Thread.Sleep(25);
}
// Close the Splash Screen.
SplashScreenManager.CloseForm(false);
}
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;
}
}
public enum SplashScreenCommand {
SetProgress,
Command2,
Command3
}