怎么让textbox 一运行就显示最底下的文本,滚动条也在对最底下。
this.textBox1.SelectionStart = this.textBox1.TextLength;
this.textBox1.ScrollToCaret();
这样写了还是不行,是不是我写错位置了?我写在窗体的load事件里面..大侠帮帮忙。
this.textBox1.SelectionStart = this.textBox1.TextLength;
this.textBox1.ScrollToCaret();
这样写了还是不行,是不是我写错位置了?我写在窗体的load事件里面..大侠帮帮忙。
private void Form1_Shown(object sender, EventArgs e)
{
this.textBox1.SelectionStart = this.textBox1.TextLength;
this.textBox1.ScrollToCaret();
}
private void ChanageTextBox(TextBox tb)
{
tb.SelectionStart = tb.Text.Length;
tb.SelectionLength = 0;
tb.ScrollToCaret();
}
this.textBox1.ScrollToCaret();
这样呢?