ParadoX

ParadoX

  • NA
  • 1
  • 0

Richtextbox: Coloring words knowing their index ?

Jun 4 2008 11:45 AM
Hi !

I've been trying to color words in a RichTextBox in red. I made this and it works:


foreach (string sentence in splittedOriginalText)
{
richTextBox1.SelectionColor = Color.Black;
for (int i = 0; i < keywords.Length; i++)
{
if (keywords == sentence.ToLower())
{
richTextBox1.SelectionColor = Color.Red;
break;
}
}
richTextBox1.SelectedText = sentence + " ";
}


Now things have changed. I don't have any keywords to compare my words to, but only the index of the words that need to be colored. I've been trying, but somehow it won't work ... any idea to help me out here ?

Answers (1)