c#,2个文本框,1个按钮
在文本框1的TextChanged事件后,把光标定位到文本框2,在文本框2的TextChanged事件后,把焦点定位到按钮,怎么写?

解决方案 »

  1.   

    winForm 下的还是 WebForm下的?
      

  2.   


            private void textBox1_TextChanged(object sender, EventArgs e)
            {
                textBox2.Focus();
            }        private void textBox2_TextChanged(object sender, EventArgs e)
            {
                button1.Focus();
            }
      

  3.   

    用TABINDEX可以不?
    或者直接FOUCS吧!
      

  4.   

    不好意思!太弱了!是winform下的!
    刚才自己看了msdn,已经知道了!
    谢谢大家!
      

  5.   

    调整号三个控件的Tab顺序
    两个TextBox的TextChanged事件都注册为下列方法
            private void textBox1_TextChanged(object sender, EventArgs e)
            {
                SendKeys.Send("{tab}");
            }
      

  6.   

     
    private void textBox1_TextChanged(object sender, EventArgs e)
            {
                textBox2.Focus();
            }        private void textBox2_TextChanged(object sender, EventArgs e)
            {
                button1.Focus();
            }
      

  7.   

    结贴太快 !最后一位没看到,没给分,sorry