RichTextBox Selection Problem
I'm parsing through long strings to change the color of certain words in a RichTextBox with this code:
Code:
If m_rtbDescription.Find(strStringToHighlight) <> -1 Then
m_rtbDescription.Select(m_rtbDescription.Find(strStringToHighlight), strStringToHighlight.Length)
m_rtbDescription.SelectionColor = color.Red
End If
This works fine in every instance EXCEPT when the starting index of the selection happens to be 0; then not only does the string I was attempting to highlight become red, but the entire long string does - it doesn't matter what length I put in for .Find's second parameter.
Any ideas what's happening?
Thanks as always,
neef