Step 1: Click New Project, then select Visual C# on the left, then Windows and then select Windows Forms Application. Name your project "MultipleColorRichText" and then click OK
Step 3: Design your form as below

Add a ColorDialog to your form as below

Step 3: Add code to handle your form
using System;
using System.Drawing;
using System.Windows.Forms;
namespace MultipleColorRichText
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Color _color = Color.Blue;
bool _first = true;
private void btnSend_Click(object sender, EventArgs e)
{
//Set color to RichTextBox
rtfResult.SelectionColor = _color;
if (_first)
rtfResult.SelectedText = txtValue.Text;
else
rtfResult.SelectedText = Environment.NewLine + txtValue.Text;
_first = false;
txtValue.Clear();
txtValue.Focus();
}
private void pColor_Click(object sender, EventArgs e)
{
//Open color dialog
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
_color = colorDialog1.Color;
pColor.BackColor = _color;
}
}
}
}
VIDEO TUTORIALS