This is a migrated thread and some comments may be shown as answers.

Highlight bookmark text

1 Answer 45 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 17 Aug 2011, 03:59 PM
Hello again, 

so i have been trying to highlight text from a bookmark, so far i have managed to highlight the first word of the bookmark but not the entire selection. This is what I have so far: 

BookmarkRangeStart bookmark = this.radRichTextBox1.Document.GetBookmarkByName("Bookmark1");
this.radRichTextBox1.Document.Selection.SelectAnnotationRange(bookmark);
this.radRichTextBox1.Document.GoToBookmark("Bookmark1");
this.radRichTextBox1.ChangeTextHighlightColor(Colors.Green); 

Any advice would be great. 

Thanks 

Marcello 

1 Answer, 1 is accepted

Sort by
0
Marcel
Top achievements
Rank 1
answered on 17 Aug 2011, 04:07 PM
Sorted, just needed to highlight before navigating:

this.radRichTextBox1.ChangeTextHighlightColor(Colors.Green); 
this.radRichTextBox1.Document.GoToBookmark("Bookmark1");

That mistake has taken me ages to find lol. 
Tags
RichTextBox
Asked by
Marcel
Top achievements
Rank 1
Answers by
Marcel
Top achievements
Rank 1
Share this question
or