Move to, find, replace and *show*

Posted on 2006-05-06
Last Modified: 2010-04-05
Hi Expert,

I have a Find & Replace action in a RichEdit control, which does find and highlight the strings entered. However, it does not move the line where it has found the string into the edit area. So the user doesn't know if the string is found, let alone where, when the text happens to be outside of the visible edit area. How can automatic scrolling of the RichEdit text, to the line found, be implemented?

Ron dW
Question by:Ron_de_Weijze
    LVL 17

    Accepted Solution


    1. If your Find/Replace routine sets the cursor to the desired position then use:

    RichEdit1.Perform(EM_SCROLLCARET, 0, 0);

    You may move the cursor setting SelStart property.

    2. If you know the line number and character number (in that line) you may use:

    RichEdit1.CaretPos := Point(ACharPos-1,ALine-1);

    Regards, Geo

    Author Comment

    Thanks Geo!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    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…
    In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    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…

    737 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

    19 Experts available now in Live!

    Get 1:1 Help Now