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

# TFindDialog

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

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

## Declaration

Source position: dialogs.pp line 370

`type TFindDialog = class(TCommonDialog)`
`protected`
`FFindForm: TForm;` |  | FFindForm - local variable holding the form used for the Find dialog
`FOnReplace: TNotifyEvent;` |  | FOnReplace - local variable identifying the event handler for replacing
`FOnFind: TNotifyEvent;` |  | FOnFind - local variable identifying the event handler for finding
`FOptions: TFindOptions;` |  | FOptions - local variable holding the set of current options
`FOnHelpClicked: TNotifyEvent;` |  | FOnHelpClicked - local variable identifying the help event handler
`FReplaceText: String;` |  | FReplaceText - local variable holding the Replace text
`FFindText: String;` |  | FFindText - local variable containing the text to be found
`procedure FindClick();` |  | FindClick - method for execution when the Find button is clicked
`procedure HelpClick();` |  | HelpClick - method to execute when the Help button is clicked
`procedure CancelClick();` |  | CancelClick - method to execute when the Cancel button is clicked
`procedure UpdatePosition;` |  | UpdatePosition - method to update the position of the cursor within the document in which text is being sought
`procedure DoCloseForm(); virtual;` |  | DoCloseForm - execute the code for closing the Find/Replace dialog form
`procedure Find; virtual;` |  | Find - software emulation of the OnFind event
`procedure Help; virtual;` |  | Help - software emulation of the OnHelpClicked event
`procedure Replace; virtual;` |  | Replace - software emulation of the OnReplace event
`function CreateForm; virtual;` |  | CreateForm - function result returns the form that was created
`procedure SetFormValues; virtual;` |  | SetFormValues - specifies the values for the form
`procedure GetFormValues; virtual;` |  | GetFormValues - finds the values for the form
`property ReplaceText: String; [rw]` |  | ReplaceText - the text string that is to be substituted for the Find text
`property OnReplace: TNotifyEvent; [rw]` |  | OnReplace - event handler for replacing text
`public`
`constructor Create(); override;` |  | Create - constructor for TFindDialog: calls inherited Create and sets initial options for Find only
`destructor Destroy; override;` |  |
`procedure CloseDialog;` |  | CloseDialog and returns its resources
`function Execute; override;` |  | A public method causing the dialog box to appear, offer the relevant choices to the user and act upon the choice
`property Left: Integer; [rw]` |  | The Left side of the dialog display
`property Position: TPoint; [rw]` |  | The Position of the dialog display
`property Top: Integer; [rw]` |  | the Top of the dialog display
`published`
`property FindText: String; [rw]` |  | FindText - the text string that the dialog will try to find
`property Options: TFindOptions; [rw]` |  | The current Options for the seeking and replacing process
`property OnFind: TNotifyEvent; [rw]` |  | OnFind - event handler for a click on the Find button
`property OnHelpClicked: TNotifyEvent; [rw]` |  | OnHelpClicked - event handler for a click on the Help button
`end;`

## Inheritance

`TFindDialog` |  | TFindDialog - a dialog used for finding text within the current editor or text buffer
`TCommonDialog` |  | TCommonDialog : the base type from which other dialogs are derived
`TLCLComponent` |  | TLCLComponent - base class for LCL components
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent`
`TObject`

## Description

Opens a dialog box allowing the user to enter text for searching, for example in a text editor.
As TFindDialog is the parent class for the TReplaceDialog,
it contains definitions for the Replace method,
but the Replace option does not actually appear when the dialog is displayed:
you need to use TReplaceDialog to do that

## See also

TReplaceDialog |  | A dialog allowing the user to replace text

The latest version of this document can be found at lazarus-ccr.sourceforge.net .