Solved

How can I set the highlight color in a Richtextbox ?

Posted on 2010-11-21
2
607 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.

734 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