Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

Select a specific line in a TRichEdit

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
steff
Asked:
steff
1 Solution
 
ronit051397Commented:
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
 
steffAuthor Commented:
That was the best of waht I could ever expect. Thanx!

Steff :-)

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now