using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace UAS_LabelMachine.CustomControl.RichText { public partial class RichTextAutoBottom : RichTextBox { public RichTextAutoBottom() { InitializeComponent(); TextChanged += RichTextBox_TextChange; } private void RichTextBox_TextChange(object sender,EventArgs e) { SelectionStart = Text.Length; ScrollToCaret(); } /// /// color设置AppendText的颜色 /// /// /// public void AppendText(string str,Color color) { SelectionColor = color; base.AppendText(str); } } }