Solved

Select a specific line in a TRichEdit

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

12 Experts available now in Live!

Get 1:1 Help Now