如何在按下"Enter"键时选择第二个文本框在C#中的第一个文本框中 [英] how to select second textbox when press "Enter" on first textbox in c#
本文介绍了如何在按下"Enter"键时选择第二个文本框在C#中的第一个文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在c#中的第一个文本框上按"Enter"时如何选择第二个文本框
非常感谢你
how to select second textbox when press "Enter" on first textbox in c#
thank u a lot
推荐答案
您需要使用Key_Press事件.
之后,您可以将焦点设置到第二个文本框.
Hi,
You need to use the Key_Press event.
After that, you may set the focus to the second textbox.
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
textBox2.Focus();
}
问候
regards
这篇关于如何在按下"Enter"键时选择第二个文本框在C#中的第一个文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文