private static void Application_Idle(object sender, EventArgs e) { Application.Idle -= new EventHandler(Application_Idle); if (applicationContext.MainForm == null) { MESMainForm mainForm = new MESMainForm(); applicationContext.MainForm = mainForm; //初始化 mainForm.InitMain(); WelcomeForm welcomeForm = applicationContext.Tag as WelcomeForm; mainForm.Show(); welcomeForm.Close(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new MESMainForm()); //return; WelcomeForm welcomeForm = new WelcomeForm(); welcomeForm.Show(); applicationContext = new ApplicationContext(); applicationContext.Tag = welcomeForm; Application.Idle += Application_Idle; Application.Run(applicationContext); }