![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 //接受用户输入参数后回车事件 2 private void tb_KeyPress(object sender, KeyPressEventArgs e) 3 { 4 if (e.KeyChar == 13) 5 { 6 SendKeys.Send("{Tab}"); 7 } 8 }
1.要在需要按回车跳转的控件中加入此事件
2.将需要跳转的控件进行顺序编号 在行为中TabIndex中写上序号
3.加入代码即可
1 //接受用户输入参数后回车事件 2 private void tb_KeyPress(object sender, KeyPressEventArgs e) 3 { 4 if (e.KeyChar == 13) 5 { 6 SendKeys.Send("{Tab}"); 7 } 8 }
1.要在需要按回车跳转的控件中加入此事件
2.将需要跳转的控件进行顺序编号 在行为中TabIndex中写上序号
3.加入代码即可
转载于:https://www.cnblogs.com/xzh1993/p/4170456.html