retep
asked on
Actual linenumber in RichEdit.
How do I find out in which linenumber my cursor is placed in a TRichEdit?
I need it, because I need to insert some text with the
Richedit1.lines.insert(<he re>,'MyStr ing');
If you have better idéas for inserting text from the cursor, that will be an answer too.
Thanks.
Retep
I need it, because I need to insert some text with the
Richedit1.lines.insert(<he
If you have better idéas for inserting text from the cursor, that will be an answer too.
Thanks.
Retep
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here it is:
function GetRow: Longint;
begin
with reEdit do
Result := Perform(EM_LINEFROMCHAR, -1, 0)+1;
end;
Yours,
Alex
function GetRow: Longint;
begin
with reEdit do
Result := Perform(EM_LINEFROMCHAR, -1, 0)+1;
end;
Yours,
Alex
hi again,
the other solution
Richedit1.Lines.Insert(Ric hedit1.Per form(EM_LI NEFROMCHAR ,Richedit1 .Selstart, 0),'Thats the New Line');
be sure that the richedit-unit is in your uses clause
meikl
the other solution
Richedit1.Lines.Insert(Ric
be sure that the richedit-unit is in your uses clause
meikl
ASKER
I have choosen to use TheNeil's answer...
Thanks to all of you :)
Thanks to all of you :)
Thanks Retep - Sorry everyone else
The Neil =:)
The Neil =:)
there are a api function, which can be used
or use richedit1.seltext := YournewText + #10;
meikl