本主题是官网指导教程 Use a Custom Class to Show a Splash Form 的补充。演示了如何创建自定义启动页(splash form
)并使用。
具体步骤
1. 创建一个Splash Form窗体
右键解决方案中的WinForms应用工程(xxx.win),在弹出菜单中选择"添加"->“新建项”。
在弹出的窗体中点击 “Windows Form” -> “窗体(Windows 窗体)”,在窗体的最下方的名称中输入文件名"SplashScreenForm.cs
",随后点击右下角的"添加"按钮。
此时在WinForms文件夹中已经可以看到刚刚创建的SplashScreenForm.cs
文件。
2.创建继承 ISplash
接口的类。
右键解决方案中的WinForms应用工程(xxx.win),在弹出菜单中选择"添加"->“类”。
在弹出的窗体中输入文件名称"MySplash.cs
",然后点击 “添加” 按钮。
在WinForms应用工程(xxx.win)中双击 MySplash.cs
文件。将文件代码替换成以下的内容:
using DevExpress.ExpressApp.Win;
//...
public class MySplash : ISplash {
static private SplashScreenForm form;
private static bool isStarted