Rich Text Box how to highlight text block

Yes you can set the BackColor of a RichTextBox Selection using the RichTextBox.SelectionBackColor Property.

int blockStart = 1; //arbitrary numbers to test
int blockLength = 15;
richTextBox1.SelectionStart = blockStart;
richTextBox1.SelectionLength = blockLength;
richTextBox1.SelectionBackColor = Color.Yellow;

Leave a Comment