How can I set the highlight color in a Richtextbox ?

Posted on 2010-11-21
Medium Priority
Last Modified: 2012-05-10
How can I set the highlight color in a Richtextbox ?

I would like to be to highlight identical words in a Richtextbox - just as you can in the VS editor.

TIA Patrick using VB 2010
Question by:patrick_otter
LVL 19

Accepted Solution

arif_eqbal earned 2000 total points
ID: 34185741
Looks like you need something like this
if one puts the cursor (clicks mouse) on a word in RTB the same word in the entire content should get highlighted. If thats what you want you can get the word under the cursor and use the function in the code here
and instead of the line
rtb.SelColor = lColor
rtb.SelectionBackColor = lColor
this will give you real highlight effect.

Author Closing Comment

ID: 34213082
Thanks very much Arif - that did the trick.


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes and provides a custom-made tool I wrote to give businesses a means of identifying commercial music content, without having to expend too much effort. Business recordings are easily identified from possibly illegal music files …
Loops Section Overview

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question