TextBox 保持固定长度,添加新行滚动到最后,跨线程。

txtBxMsg.BeginInvoke((MethodInvoker)delegate
{
if (txtBxMsg.Text.Length > 10000)
txtBxMsg.Text = txtBxMsg.Text.Substring(txtBxMsg.Text.Length - 10000);
txtBxMsg.AppendText( " " + AMsg);
txtBxMsg.ScrollToCaret();
});

原文地址:https://www.cnblogs.com/percent10/p/11809055.html