I need to color in the RichTextBox a text before a string For example:
"Highlight: normal highlight"
I need to color in the RichTextBox a text before a string For example:
"Highlight: normal highlight"
See if this can help you
private void ColourRrbText(RichTextBox rtb)
{
Regex regExp = new Regex("^([^:]*)");
foreach (Match match in regExp.Matches(rtb.Text))
{
rtb.Select(match.Index, match.Length);
rtb.SelectionColor = Color.Blue;
}
}