private void timerCheck_Tick(object sender, EventArgs e) { if (!checkConnection) { if (pgbProgress.Value == 100) { timerCheck.Stop(); backgroundWorker.WorkerSupportsCancellation = true; backgroundWorker.CancelAsync(); MessageBox.Show("Time out!"); Application.Exit(); } else { pgbProgress.Increment(10); labelProgress.Text = "Progressing...(" + pgbProgress.Value + "%)"; } } else { timerCheck.Stop(); /* frmMain main = new frmMain(); * main.Show();*/ show?.Invoke(); this.Hide(); } }
private void btnOut_Click(object sender, EventArgs e) { var res = MessageBox.Show("你确定要重新登陆吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (res == DialogResult.Yes) { SaveSomeSet(); ShowLogin?.Invoke(); this.Close(); } }