Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Select a specific line in a TRichEdit

Posted on 1997-07-26
2
Medium Priority
?
155 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
[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 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

721 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