Difference between revisions of "TFindDialog"
From Free Pascal wiki
Jump to navigationJump to searchLine 1: | Line 1: | ||
'''TFindDialog''' [[Image:tfinddialog.png]] is a component that aids in finding information. It can be found on the [[Dialogs tab]] of the [[Component Palette]]. | '''TFindDialog''' [[Image:tfinddialog.png]] is a component that aids in finding information. It can be found on the [[Dialogs tab]] of the [[Component Palette]]. | ||
− | To activate a | + | To activate a FindDialog, just call its <tt>Execute()</tt> function. Create an <tt>OnFind</tt> method to perform the actual find. |
[[image:component-TFindDialog.png]] | [[image:component-TFindDialog.png]] |
Revision as of 12:55, 11 September 2016
TFindDialog is a component that aids in finding information. It can be found on the Dialogs tab of the Component Palette.
To activate a FindDialog, just call its Execute() function. Create an OnFind method to perform the actual find.
Usage
procedure TMyForm.Button1Click(Sender: TObject);
begin
FindDialog1.Execute();
end;
procedure TMyForm.FindDialog1Find(Sender: TObject);
var
k: integer;
begin
with Sender as TFindDialog do begin
k := Pos( FindText, Memo1.Lines.Text );
if k>0 then begin
Memo1.Selstart := k;
Memo1.SelLength := length( FindText );
end else
Beep();
end;
end;
See also