c#中通过事件实现按下回车跳转控件

1 //接受用户输入参数后回车事件
2         private void tb_KeyPress(object sender, KeyPressEventArgs e)
3         {
4             if (e.KeyChar == 13)
5             {
6                 SendKeys.Send("{Tab}");
7             }
8         }
View Code

1.要在需要按回车跳转的控件中加入此事件

2.将需要跳转的控件进行顺序编号 在行为中TabIndex中写上序号

3.加入代码即可

原文地址:https://www.cnblogs.com/xzh1993/p/4170456.html