当上一个文本框被数据填充时,将焦点移到下一个文本框 [英] Focus to next textbox when previous textbox is filled by an data

查看:118
本文介绍了当上一个文本框被数据填充时,将焦点移到下一个文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请任何人指导我
当数据是字符串或数字时,如果前一个文本框被数据填充,则将焦点移到下一个文本框.

PLEASE ANYBODY GUIDE ME
Focus to next textbox when previous textbox is filled by an data wheather the data is string or numeric.
Thanks in Advance!

推荐答案

适当设置tabindex的值.
结果,用户应该只能按下Tab键,而控制应该集中在下一个文本框.
Set the tabindex''s appropriately.
As a result, the user should just be able to press tab and control should focus to the next textbox.


hi,

添加这一个



add this one

Textbox1.Focus()




快乐的编码




happy coding




如此简单

我正在添加Windows窗体C#代码,您可以轻松地将其更改为vb,只需查看此





so simple

i am adding windows form c# code u can easly change to vb just look this



private void textBox1_TextChanged(object sender, EventArgs e)
{
    int s = textBox1.Text.Length;
    if (s==6)
    {
        textBox2.Focus();
    }
}




txtbx1一旦有6个字符,它将自动聚焦到txtbx 2


快乐的编码
如有疑问,请问我




where once txtbx1 has 6 charecter it automatically focus to txtbx 2


happy coding
any doubt ask me


这篇关于当上一个文本框被数据填充时,将焦点移到下一个文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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