private void btnLock_Click(object sender, EventArgs e) { if (!cmn.Confirm("确定锁定屏幕?")) { return; } ThreadStart ts = new ThreadStart(GrayScaleForm); Thread th = new Thread(ts); th.Start(); FormLockScreen frmLockScreen = new FormLockScreen(); if (frmLockScreen.ShowDialog() == DialogResult.OK) { if (th.IsAlive) { th.Abort(); } GrayPnl.BackgroundImage = null; GrayPnl.Visible = false; msBar.Visible = true; } }