Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Move to, find, replace and *show*

Posted on 2006-05-06
Medium Priority
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

geobul earned 1000 total points
ID: 16623936

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

ID: 16624533
Thanks Geo!

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

577 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