打开你的“Program.cs”。将代码修改如下,其中 SplashFrm 是在 Application.Run 调用中创建的当前 Form
static class Program
{
private static EventHandler idleTemp;
private static SplashFrm splash;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
splash = new SplashFrm();
splash.Show();
idleTemp = new EventHandler(Application_Idle);
Application.Idle += idleTemp;
Application.Run(new AMBR());
}
static void Application_Idle(object sender, EventArgs e)
{
splash.Close();
Application.Idle -= idleTemp;
idleTemp = null;
splash = null;
}
}
然后,在成功加载 AMBR 后,调用Application.RaiseIdle(null);
并关闭并清理您的启动画面。