通过输入进入下一个标签索引 [英] go to next tab index by enter

查看:84
本文介绍了通过输入进入下一个标签索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
当我想通过按Enter键转到Windows窗体中的下一个TabIndex时该怎么办??????????
请帮助我

hi all dev,
what can i do when i want to go to next TabIndex in my windows form by pressing Enter key???????????
please help me

推荐答案

我强烈建议您不要.

正常"用户习惯于在所有Windows应用程序中执行某些特定功能的某些键:TAB将您带到下一个控件,SHIFT + TAB将您带到上一个控件. ENTER按下确定"按钮-或突出显示任何按钮.

颠覆该机制不仅需要大量工作,而且还会使您的应用程序变得不规范,并惹恼用户,并使他们不愿使用您的应用程序.
I would strongly suggest that you don''t.

"Normal" users are used to some keys doing specific things in all windows apps: TAB takes you to the next control, SHIFT+TAB takes you to the previous. ENTER presses the "OK" button - or whatever button is highlighted.

Not only is it a fair amount of work to subvert this mechanism, but it will also make your application non-standard, and annoys users, and makes them less willing to use your application.


private void Form_KeyDown(object sender, KeyEventArgs e)
{
    if(Keys.Enter == e.KeyCode)
    {
       SendKeys.Send("{TAB}");
       e.Handled = true;//set to false if you need that textbox gets enter key
    }
}


这篇关于通过输入进入下一个标签索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆