private void NewFormDown(object sender, KeyEventArgs e) { DialogResult dr = MessageBox.Show("是否打开新窗口?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { NewForm newForm = new NewForm(); newForm.Show(); } else { this.Close(); } }
private void MainMouseClick(object sender, MouseEventArgs e) { NewForm newForm = new NewForm(); newForm.Show(); }