In my RichtextBox
, if I have written as below.
This is my pen,
his pen is beautiful.
Now I search word "is" then output would be as below.
All "is" should be highlighted.
In my RichtextBox
, if I have written as below.
This is my pen,
his pen is beautiful.
Now I search word "is" then output would be as below.
All "is" should be highlighted.
Using this method, you will able to highlight multiple words at the same time. Or you can easily skip the
foreach
part and use it to highlight just a single word.What about:
This will show all the searched criteria at the same time.
Using: 1 Textbox (to enter the text to search for) and 1 Button (to Run the Search).
Enter your search criteria inside the textbox and press search button.
}
Looks like this would do it.
http://www.dotnetcurry.com/ShowArticle.aspx?ID=146
If you only want to match the whole word you can use this, note that this ignores case and also the |s\b means that plurals get highlighted e.g. Cat matches cats but not caterpiller :