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
}
posted @ 2016-06-20 15:57  会弹猫的吉他  阅读(2135)  评论(0编辑  收藏  举报