Enter键不作为Tab键 [英] Enter key doesn't act as Tab key
本文介绍了Enter键不作为Tab键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在Windows窗体中有不同类型的控件,当我按下回车键时它应该作为标签..
i的函数类似于
Hi all,
I have different types of controls in my windows form,when i press enter key it should act as tab..
i have written function like
private void keypressevents(KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
SendKeys.Send("{TAB}");
}
}
并在表格的按键事件中称为keypressevents(e)。
但结果是否定的...... plz帮助我..
and called "keypressevents(e)" in form's keypress event.
but the result is negative...plz help me..
推荐答案
假设,你故意用asp.net标记你的问题,你错误地写了窗体:
你无法在服务器端处理这个问题。
您必须使用JavaScript在客户端执行此操作。阅读以下内容:
http://www.dotnetcurry.com/ShowArticle.aspx?ID = 538 [ ^ ]
http://paulwerickson.com/jquery-how-to -tab-with-enter-key / [ ^ ]
假设你错误地用asp.net标记了你的问题,而你故意写windows窗体:
看这里:从Windows窗体TextBox重定向Enter键 [ ^ ]
Assuming, that you tagged you your question deliberately with asp.net, and you write windows forms by mistake:
You can't handle this on server side.
You have to do it on client side with JavaScript. Read these:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=538[^]
http://paulwerickson.com/jquery-how-to-tab-with-the-enter-key/[^]
Assuming, that you tagged you your question by mistake with asp.net, and you write windows forms deliberately:
Look here: Redirect the Enter key from a Windows Forms TextBox[^]
这篇关于Enter键不作为Tab键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文