摘要:
1)TextBox的KeyUp事件,即在按下键盘后,抬起的时候触发的事件跳转
2)判断e.KeyCode是否为回车键
3)使用buttern1_Click(sender,e)实现按钮的点击
private void textBox1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Control || e.KeyCode == Keys.Enter)
{
button1.Focus();
button1_Click(sender, e);
}
}