Sign in Join
Wiki copytemporary

TFindDialog/fr: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: TFindDialog/fr

OldNewLine
1+**TFindDialog** ![](/wiki-images/9/9e/Tfinddialog.png) est un composant non visuel qui donne accès à une boîte de dialogue qui assiste dans la sélection d'un texte à rechercher. . Pour activer un FindDialog, il suffit d'appeler sa méthode `Execute()`. Créez ensuite un gestionnaire pour l'événement `OnFind` pour réaliser le code de recherche.
2+
3+<figure>
4+<img src="component-TFindDialog.png" title="component-TFindDialog.png" />
5+<figcaption>component-TFindDialog.png</figcaption>
6+</figure>
7+
8+# Usage
9+
10+``` pascal
11+procedure TMyForm.Button1Click(Sender: TObject);
12+begin
13+ FindDialog1.Execute();
14+end;
15+
16+procedure TMyForm.FindDialog1Find(Sender: TObject);
17+var
18+ k: integer;
19+begin
20+ with Sender as TFindDialog do begin
21+ k := Pos( FindText, Memo1.Lines.Text );
22+ if k>0 then begin
23+ Memo1.Selstart := k;
24+ Memo1.SelLength := length( FindText );
25+ end else
26+ Beep();
27+ end;
28+end;
29+```
30+
31+# Voir aussi
32+
33+- [[doc:lcl/dialogs/tfinddialog.html|Doc. TFindDialog]]
34+- [[TReplaceDialog/fr|TReplaceDialog]]
35+
36+---
37+*From the Free Pascal wiki, page "TFindDialog/fr", 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](/wiki-contact).*

Back to history