Solved

How can I set the highlight color in a Richtextbox ?

Posted on 2010-11-21
2
604 Views
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
0
Comment
Question by:patrick_otter
2 Comments
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 500 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
http://support.microsoft.com/kb/154884
and instead of the line
rtb.SelColor = lColor
Use
rtb.SelectionBackColor = lColor
this will give you real highlight effect.
0
 

Author Closing Comment

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

Patrick
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

912 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now