[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Actual linenumber in RichEdit.

Posted on 2000-04-25
6
Medium Priority
?
155 Views
Last Modified: 2013-11-22
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(<here>,'MyString');

If you have better idéas for inserting text from the cursor, that will be an answer too.

Thanks.
Retep
0
Comment
Question by:retep
[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
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2747830
hi retep,

there are a api function, which can be used

or use richedit1.seltext := YournewText + #10;

meikl
0
 
LVL 5

Accepted Solution

by:
TheNeil earned 200 total points
ID: 2747831
Use the CaretPos property of the RichEdit component. In your case your call to Insert needs to be

RichEdit1.Lines.Insert(RichEdit1.CaretPos.Y, 'MyString');

The Neil =:)
0
 
LVL 15

Expert Comment

by:simonet
ID: 2747841
Here it is:

function GetRow: Longint;
begin
  with reEdit do
    Result := Perform(EM_LINEFROMCHAR, -1, 0)+1;
end;


Yours,

Alex
0
Technology Partners: 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!

 
LVL 27

Expert Comment

by:kretzschmar
ID: 2747856
hi again,

the other solution

  Richedit1.Lines.Insert(Richedit1.Perform(EM_LINEFROMCHAR,Richedit1.Selstart,0),'Thats the New Line');

be sure that the richedit-unit is in your uses clause

meikl
0
 

Author Comment

by:retep
ID: 2747893
I have choosen to use TheNeil's answer...

Thanks to all of you :)
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2747942
Thanks Retep - Sorry everyone else

The Neil =:)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
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…
Suggested Courses

656 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