Reid
Reid

Reputation: 4534

Multiple Highlights/Selects in C# with different colors

I am looking for a way to highlight a word and a sentence at the same time in C#. An example of what I am trying to accomplish is shown below.

Created from MS Word

I am working with windows forms, but I would be able to port over to WPF if nessassary.

I have been trying to accomplish this with a rich text box, but I cant seem to find a method to do what I want. Is there anything out there that could accomplish this?

Upvotes: 0

Views: 337

Answers (1)

CodeCaster
CodeCaster

Reputation: 151594

Find the start of the sentence, set the SelectionBackColor, then Find the word you're looking for from the offset of the previous Find() call and set the SelectionBackColor again.

Upvotes: 3

Related Questions