rvico TRichView Reference | How to...

...implement Find and Replace dialogs

Top  Previous  Next


The key method is TRichView.SearchText or TRichViewEdit.SearchText.

Search can be case sensitive or not, up or down. "Whole word" option is also supported.

You can convert options from Find dialog to SrchOptions parameter of these methods using GetRVSearchOptions or GetRVESearchOptions.


Use TRichViewEdit.SearchText to select the old string.

Then use InsertText to replace it with the new one. This method removes the selected part of document before performing insertion. If you search in backward direction, set CaretBefore parameter to True.



Find dialog is implemented in the main editor demo:

Demos\Delphi\Editors\Editor 1\

Demos\CBuilder\Editors\Editor 1\

Both Find and Replace dialogs are implemented in the demo:

Demos\Delphi\Assorted\Search and Replace\

Demos\CBuilder\Assorted\Search and Replace\

Alternatively, you can use RichViewActions.

TRichView © trichview.com