VCL.FindRep Sample

From RAD Studio Code Examples
Jump to: navigation, search

Language:

This sample demonstrates how to use Find and Replace dialogs.

Contents

Location

You can find the FindRep sample project at:

Description

This application creates a form with a TRichEdit control and a Edit menu with two items: Find and Replace. Choose Find or Replace from the menu to find and replace text in the RichEdit control.

How to Use the Sample

  1. Navigate to Start > Programs > Embarcadero RAD Studio > Samples and open FindRep.cbproj
  2. Press F9 or choose Run > Run

Files

The project has one source file, mainform.cpp, which contains the main form class.

Classes

Implementation

  • The main form contains a FindDialog and a ReplaceDialog component. They are executed when the user chooses Find or Replace from the menu. The OnFind and OnReplace events for these two dialogs are handled by the Find and Replace methods.
  • SelText method is used so that the selected text in the RichEdit is the default string to find.
  • TSearchTypes class is used to perform a search with two options: Match only whole words and Match case.

Uses

See Also

Personal tools