当输入的文本够多时,如何使控件richTextBox1的滚动条一直在最下方

C#语言

用richTextBox1的TextChanged事件
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
this.richTextBox1.SelectionStart = int.MaxValue; //如果文本大于后者
this.richTextBox1.ScrollToCaret();
}
int.MaxValue你也可以随便取一个值,但是要比较大。用int.MaxValue比较安全
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答