日期:2014-05-20 浏览次数:20942 次
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text.Length == 3)
textBox2.Focus();
}
------解决方案--------------------
在TextBox1文本框的Changed事件中进行判断,如果输入长度等于3,光标自动转至TextBox2中。
if (textBox1.Text.Length == 3)
{
textBox2.Focus();
}
------解决方案--------------------
var tbtxt=document.getElementById("tb1");
if(tbtxt.value.length>=3)
{
document.getElementById("tb2").focus();
}
------解决方案--------------------
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text.Length == 3)
textBox2.Focus(); //得到焦点
}