I'm parsing through long strings to change the color of certain words in a RichTextBox with this code:
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.Code:If m_rtbDescription.Find(strStringToHighlight) <> -1 Then m_rtbDescription.Select(m_rtbDescription.Find(strStringToHighlight), strStringToHighlight.Length) m_rtbDescription.SelectionColor = color.Red End If
Any ideas what's happening?
Thanks as always,
neef



Reply With Quote