• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 525
  • Last Modified:

RichEdit Highlight Line

In a Richtext edit control there are methods to select a line and cause the backgound to go black and format controls to colorize the text or set the background color for the entire control but there are no methods or format controls to highlight a single line (i.e. cause the background color to change as in Word for windows rich text mode which allows line hightlighting)
How can a single line of text be highlighted in a richedit control?
0
hrybyk
Asked:
hrybyk
1 Solution
 
trestanCommented:
Pls try the online help at:
Platform, SDK, and DDK Documentation -> Platform SDK -> User Interface Services -> User Input -> Mouse Input -> Selecting a Line of Text
0
 
hrybykAuthor Commented:
How do you highlight a line independent of the current selected text?
0
 
NancyOCommented:
I'm a little confused on what you are trying to do.  Are you saying that you want to be able to hilight two sections of the text at a time, so that you can hilight a particular line of text without destroying any selections that already exist?
0
 
timopCommented:
Code to highlight a single line:

CRichEditCtrl re;


// nLineNumber - line number , zero-based
re.SetSel( re.LineIndex( nLineNumber ),  re.LineIndex( nLineNumber + 1 ) );

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now