Add Colored Text To RichTextBox
Created at: 2020-09-24 07:38:02Modified at: 2025-09-19 21:57:08You can add this function to display colored text in a richtextbox! [Just Append With that Function]
private void AddTextToRTB(RichTextBox rtb, string txt, Color col)
{
int pos = rtb.TextLength;
rtb.AppendText(txt);
rtb.Select(pos, txt.Length);
rtb.SelectionColor = col;
rtb.Select();
rtb.DeselectAll();
}
Caution: I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.