C#TextBox自动滚动到最低端

C#中一个RichTextBox,当新写入内容时,超过当前显示区域后,自动滚动到最低端,方便查看内容。

private void txtInfo_TextChanged(object sender, EventArgs e)
{
    txtInfo.SelectionStart = txtInfo.Text.Length; //Set the current caret position at the end
    txtInfo.ScrollToCaret(); //Now scroll it automatically
}
原文地址:https://www.cnblogs.com/XuPengLB/p/5600793.html