码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2014-12-17 22:21:03      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   ar   color   os   sp   on   div   

bubuko.com,布布扣
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.加入代码即可

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

标签:style   blog   http   ar   color   os   sp   on   div   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!