I have a window form that contain a listbox and some richtextboxex. listbox contains some values. When I select any value from l
Something like this should work (just tested this.. seems to work fine):
int openBrace = richTextBox.Text.IndexOf("<");
while (openBrace > -1) {
int endBrace = richTextBox.Text.IndexOf(">", openBrace);
if (endBrace > -1) {
richTextBox.SelectionStart = openBrace;
richTextBox.SelectionLength = endBrace - openBrace;
richTextBox.SelectionColor = Color.Blue;
}
openBrace = richTextBox.Text.IndexOf("<", openBrace + 1);
}