Sign in Join
Wiki copytemporary

Revision 1 of 2, by Trev on 3-1-2020. The page as it is now.

TFindDialog/ru

TFindDialog этот компонент помогает в поиске информации. Он расположен на вкладке Dialogs палитры компонентов.

Для вызова FindDialog, используйте функцию Execute(). Используйте событие OnFind, что бы произвести поиск.

<figure> <img src="component-TFindDialog.png" title="component-TFindDialog.png" /> <figcaption>component-TFindDialog.png</figcaption> </figure>

Использование

pascal
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;

См. также


From the Free Pascal wiki, page "TFindDialog/ru", as it stood on 2020-03-01 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.