Is there a way to remove the highlighted text once you select the next item? Here is a rough code, but it doesn't reset the color. What I observed is that one cannot pinpoint which word is being highlighted next because the previous words are highlighted! So, I thought maybe there should be one way to reset the color once you move to the next item to allow the user to know which word has been highlighted next! Can you help with this? If the search word highlights part of that phrase again that was previously highlighted, I want the user to know which part of that phrase is going to be replace.
Code:If foundIndex >= startZ Then ContextMenuStrip1.Items.Clear() For Each replacement In replacements(checkWord) ContextMenuStrip1.Items.Add(replacement.ToLowerInvariant, Nothing, Sub(sender As Object, e As EventArgs) RichTextBox1.SelectedText = GetWordWithOutBracketedText(John) End Sub) Next ContextMenuStrip1.Show(RichTextBox1, RichTextBox1.GetPositionFromCharIndex(RichTextBox1.SelectionStart + RichTextBox1.SelectionLength)) endindex = checkWord.Length RichTextBox1.Select(foundIndex, endindex) RichTextBox1.SelectionColor = Color.Blue End If




Reply With Quote
