Solved

Select a specific line in a TRichEdit

Posted on 1997-07-26
2
147 Views
Last Modified: 2010-04-04
Cant anyone tell me a easy way to make a specific line in a TRichEdit selected if you are just given the linenumber.

I want a procedure SelLine(I : LongInt) that makes line no. I in RichEdit1 the selected(highlighted) line.
I guess there is a easy way, but I just cant figure out what it is.

Thanx - Steff.
0
Comment
Question by:steff
2 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1339938
procedure SelLine(FRow: Integer);
var FLineBegin, FLineEnd: Integer;
begin
  with Form1.RichEdit1 do
  begin
    Setfocus;
    FLineBegin:=Perform(em_lineindex, FRow, 0);
    FLineEnd:=Perform(em_linelength, FLineBegin, 0);
    Perform(em_setsel,FLineBegin,FLineBegin+FLineEnd);
  end;
end;

0
 

Author Comment

by:steff
ID: 1339939
That was the best of waht I could ever expect. Thanx!

Steff :-)

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

Title # Comments Views Activity
Delphi 10 Seattle Dataset Actions 5 78
How to fill array with TArray.Create? 14 78
creating threads in delphi 1 82
Firemonkey webbrowser scrollbars ? 1 29
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

919 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

22 Experts available now in Live!

Get 1:1 Help Now