using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.KeyPreview = true; this.KeyDown += new KeyEventHandler(form1_KeyDown); } private void form1_KeyDown(object sender,KeyEventArgs e) { if (e.Modifiers==(Keys.Control|Keys.Alt)&&e.KeyCode==Keys.Q) { new Form2().ShowDialog(); } if (e.KeyCode==Keys.Enter) { button1_Click(null,null); } } private void button1_Click(object sender, EventArgs e) { new Form3().ShowDialog(); } } }
世界上最可怕事情是比我们优秀的人比我们还努力