如何在运行时将选项卡控件从一个文本框移动到另一个文本框 [英] how can i move tab control at runtime from one text box to another text box

查看:99
本文介绍了如何在运行时将选项卡控件从一个文本框移动到另一个文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个文本框,我希望当用户在第一个文本框中输入两位数字时,我的光标(或选项卡控件)会自动移动到另一个文本框. .

i have two text box , and i want that when user enter two digit value in first text box i cursor(or tab control) automatically move to another text box.,...please help me.......

推荐答案

我同意Prera​​k,使用OnTextChanged事件是可能的.

如果(textBox1.Text.Length == 2)
{
textBox2.Focus();
}
i agree with Prerak , Using OnTextChanged Event it is possible.

If (textBox1.Text.Length == 2)
{
textBox2.Focus();
}


您可以在TextChanged中执行此操作.您可以更改条件以适合您的需求.使用Focus更改焦点.
You can do that in TextChanged. You can change condition to fit your needs. Use Focus to change to focus.
If (textBox1.Text.Length == 2)
{
 textBox2.Focus();
}


这篇关于如何在运行时将选项卡控件从一个文本框移动到另一个文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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