Solved

RichEdit Highlight Line

Posted on 1998-07-14
4
504 Views
Last Modified: 2013-12-03
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
Comment
Question by:hrybyk
4 Comments
 
LVL 8

Expert Comment

by:trestan
ID: 1410073
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
 

Author Comment

by:hrybyk
ID: 1410074
How do you highlight a line independent of the current selected text?
0
 

Expert Comment

by:NancyO
ID: 1410075
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
 
LVL 1

Accepted Solution

by:
timop earned 200 total points
ID: 1410076
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…

861 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