以下所示:object
private void txtKCodeSN_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { btnAdd_Click(null, null); } }void