Hi,
I�m fairly new at VB.Net and I�m having a few problems highlighting text in a Rich Text Box. I am working on a text editor that will have some text in the RTF Box and a regular text box where the user can enter a search term. When the find button is clicked, the first occurrence of the search term in the RTF box is highlighted if it exists in the Rich TextBox. If find is clicked again, the highlight moves to the next occurrence of the search term and so on.
What I have done so far (not sure if this is the best way) is to put the contents of the RTF box into a string variable, search the string with the RTF contents for the find term, highlight the term, and then remove the first occurrence of the search term and everything before it from the string. Problem is, the RTF textbox displayed will need to keep all of the text, so when I search again, the highlighting messes up.
Can someone help me with this?