让文本框聚焦,但是文本不能全选,该怎么写啊?
多谢了

解决方案 »

  1.   

    textBox1.Focus();
    textBox1.SelectionStart=10;
      

  2.   

                textBox1.Focus();
                textBox1.SelectionStart = 1;/////"1"代表光标在第1个字符之后
      

  3.   

                textBox1.Focus();////获得焦点
                textBox1.SelectionStart = 1;/////"1"代表光标在第1个字符之后
                textBox1.SelectionLength = 2;/////选中‘第2和第3个字符’,根据需要自己调整吧
      

  4.   

                textBox1.Focus();////获得焦点
                textBox1.SelectionStart = 1;/////"1"代表光标在第1个字符之后
                textBox1.SelectionLength = 2;/////选中‘第2和第3个字符’,根据需要自己调整吧
      

  5.   

                textBox1.Focus();////获得焦点
                textBox1.SelectionStart = 1;/////"1"代表光标在第1个字符之后
                textBox1.SelectionLength = 2;/////选中‘第2和第3个字符’,根据需要自己调整吧