[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Dialogs' (#lcl)

# TReplaceDialog

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements a find and replace dialog.

## Declaration

Source position: dialogs.pp line 515

`type TReplaceDialog = class(TFindDialog)`
`protected`
`function DefaultTitle; override;` |  | Default value for the Title property used on the replace dialog.
`procedure ReplaceClick();` |  | ReplaceClick - code to execute when the Replace button is clicked (replace just the current instance).
`procedure ReplaceAllClick();` |  | ReplaceAllClick - code to execute when the Replace All button is clicked (replace all remaining instances).
`function CreateForm; override;` |  | Gets the form instance displayed when dialog is executed.
`procedure SetFormValues; override;` |  | Copies property values from the class instance to the controls on the dialog form.
`procedure GetFormValues; override;` |  | Copies property values from the dialog form to class instance after the dialog has been executed.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`published`
`property ReplaceText: string;` |  | String with the value used to replace the value in FindText.
`property OnReplace: TNotifyEvent;` |  | Event handler signalled to replace occurrence(s) of FindText with the value in ReplaceText.
`end;`

## Inheritance

`TReplaceDialog` |  | Implements a find and replace dialog.
`TFindDialog` |  | TFindDialog - a dialog used for finding text within the current editor or text buffer.
`TCommonDialog` |  | The base type from which other dialogs are derived.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

The dialog appears and offers boxes for the user to enter text for searching and text to replace it, for example while editing a file or large piece of text.

A number of buttons appear, offering the choice to replace this instance, find next, replace all.

## See also

TFindDialog |  | TFindDialog - a dialog used for finding text within the current editor or text buffer.