To select a piece of text, use TextMarker. The following code emphasizes the word "Error" with a red wavy line.
TextEditorControl textEditor = new TextEditorControl(); textEditor.Text = "Mark Error"; int offset = 5; int length = 5; TextMarker marker = new TextMarker(offset, length, TextMarkerType.WaveLine, Color.Red); textEditor.Document.MarkerStrategy.AddMarker(marker);
You can select text with any background and foreground color, and TextMarkerType supports underline, wavy lines, or a solid block of color.
source share