?
Solved

Get cursor Y position in Rich Edit

Posted on 1998-10-18
3
Medium Priority
?
491 Views
Last Modified: 2006-11-17
How do i get the line where the cursor is in a Rich Edit Control. Not the cursor caracter position with Selstart but
The LINE position.
Anyone knows?

THX.
Avataris
0
Comment
Question by:genanja
[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
3 Comments
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 800 total points
ID: 1343287
Hi

You use the EM_LINEFROMCHAR message.  For example, if you have a TRichEdit called rchTest, you could do the following:
  LineNum := rchTest.Perform(EM_LINEFROMCHAR, -1, 0);
(0 = 1st line, 1 = 2nd line, etc.)

For any character position, the following will return the line number:
  LineNum := rchTest.Perform(EM_LINEFROMCHAR, CharIndex, 0);

Similarly, the following will return the character index (like SelStart) for the 1st character on a line:
  CharIx := rchTest.Perform(EM_LINEINDEX, LineNum, 0);

Cheers,
JB
0
 

Author Comment

by:genanja
ID: 1343288
Jim you are wonderfull. It's working perfectly
Thank you very very much.....

Avataris

0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1343289
;-)  Glad to help.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

770 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