static void Main(string[] args) { try { DevExpress.UserSkins.OfficeSkins.Register(); DevExpress.Skins.SkinManager.EnableFormSkins(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //自动更新 if ((args == null || args.Length == 0 || args[0] != "StartNormal") && File.Exists("RDAutoGradeNew.exe")) { Process.Start("RDAutoGradeNew.exe", "StartAutoGrade"); return; } FmLoading fmLoading = new FmLoading(); fmLoading.ShowDialog(); FmLogin fmLogin = fmLoading.fmLogin; DialogResult res = fmLogin.ShowDialog(); if (res != DialogResult.OK) { return; } Application.Run(new FmMain()); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnChangeUser_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { FmLogin fmLogin = new FmLogin(); if (fmLogin.ShowDialog() == DialogResult.OK) { Init(); if (fmMain != null) { fmMain.Init(operatorMenu); } } }
private void FmLoading_Load(object sender, EventArgs e) { new Action(() => { Thread.Sleep(1000); } ).BeginInvoke(new AsyncCallback( delegate(IAsyncResult iAsyncResult) { if (iAsyncResult.IsCompleted) { Invoke(new Action(() => { this.Close(); fmLogin = new FmLogin(); } )); } }), null); }