xxxxxxxxxx
// Set the text color and font
richTextBox1.SelectionColor = Color.Red;
richTextBox1.SelectionFont = new Font("Arial", 12, FontStyle.Bold);
// Append text to the control with the specified color and font
richTextBox1.AppendText("This text is bold and red!");
// Set the text color and font back to the default values
richTextBox1.SelectionColor = richTextBox1.ForeColor;
richTextBox1.SelectionFont = richTextBox1.Font;
xxxxxxxxxx
// Set the text color to blue
richTextBox1.SelectionColor = Color.Blue;
// Append text to the control with the specified color
richTextBox1.AppendText("Hello, world!");
// Set the text color back to the default color
richTextBox1.SelectionColor = richTextBox1.ForeColor;