private void Form1_load(object sender, EventArgs e){ this.AcceptButton = EnterButton; this.CancelButton = EscButton;}//配置窗体的两个属性即可