Add a text with a specific font and color to a RichTextBox control.
static class extensionMethods
{
public static void AppendText(this RichTextBox textBox, string appendText,
System.Drawing.Color textColor = null, Font TextFont = null)
{
textBox.SelectionStart = textBox.TextLength;
textBox.SelectionLength = 0;
if (textColor != null) textBox.SelectionColor = textColor;
if (textFont != null) textBox.SelectionFont = textFont;
textBox.AppendText(appendText);
textBox.SelectionColor = textBox.ForeColor;
}
};