用AppendText方法增加文本内容后,如何让里面的焦点转到文本最末?

解决方案 »

  1.   

    this.textBox1.AppendText("123");
                this.textBox1.Focus(); 试过,应该可以!
      

  2.   

    TextBox t;
    t.SelectionStart = t.SelectionLength;
      

  3.   

    TextBox t;
    t.SelectionStart = t.Text.Lenth;
    t.SelectionLength=0;
      

  4.   

    t.SelectionStart = t.Text.Lenth-1;
      

  5.   

    this.textBox1.SelectionStart = this.textBox1.Text.Length;
    这个是可以用的呀
    你不要用鼠标点  用Tab选
    就能看出光标在最后
      

  6.   

    this.richTextBox.SelectionStart = this.richTextBox.Text.Length;
    this.richTextBox.ScrollToCaret();
      

  7.   

    this.textBox.SelectionStart = this.textBox.Text.Length;
    this.textBox.ScrollToCaret();
      

  8.   

    给出一个简单实用的做法吧this.textBox.HideSelection = false;
    this.textBox.Append(s);