C#winform的Richtextbox控件实现自动滚动到最后一行功能
这里有两种情况
如果是采用的是richtextbox的AppendText的方法添加的内容,则只需
设置HideSelection为false
如果采用的是其他添加内容的方法,则需要添加TextChanged事件方法
private void txb_ReciveData_TextChanged(object sender, EventArgs e) { txb_ReciveData.SelectionStart = txb_ReciveData.Text.Length; //Set the current caret position at the end txb_ReciveData.ScrollToCaret(); //Now scroll it automatically }