2 Simple Memo Quoestions

Posted on 2006-05-29
Last Modified: 2010-04-05

How could I place the cursor in the middle after I insert the text ? Let`s say I insert <a></a> and I want the cursor between the tags.

Also if u can tell me how should I do when I press enter in the memo to replace add <br> before the new line ...

Question by:crystyan
    1 Comment
    LVL 28

    Accepted Solution

    1) use the SelStart property. you will have to calculate the exact pozition according to your needs (I would guess that <a></a> will not be the only text in the memo ;)

    2) use the onkeypress event:
    procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
    var i:integer;
      if key=#13 then


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    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…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, 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…

    745 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

    16 Experts available now in Live!

    Get 1:1 Help Now