Solved

Select a specific line in a TRichEdit

Posted on 1997-07-26
2
146 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

14 Experts available now in Live!

Get 1:1 Help Now