Last Updated: February 25, 2016
·
259
· noobik

[RichTextBoxEntension] - Append Multiline/Multicolor Text

public static class RichTextBoxExtensions
    {
        public static void AppendText(this RichTextBox oBox, string sText, Color oColor)
        {
            oBox.SelectionStart = oBox.TextLength;
            oBox.SelectionLength = 0;
            oBox.SelectionColor = oColor;
            oBox.AppendText(sText + "\r\n");
            oBox.SelectionColor = oBox.ForeColor;
            oBox.ScrollToCaret();
        }
    }