TReplaceDialog/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: TReplaceDialog/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | **TFindDialog**  est un composant non visuel qui donne accès à une boîte de dialogue qui assiste dans la recherche et le remplacement d'un texte dans un autre. . | |
| 2 | + | ||
| 3 | + | \]\] | |
| 4 | + | ||
| 5 | + | # Usage | |
| 6 | + | ||
| 7 | + | Un exemple pour utiliser un TReplaceDialog avec un [[TSynEdit]]. L'événement `OnReplace` sera exécuté quand le bouton 'Replace' dans la boîte de dialogue est pressé. | |
| 8 | + | ||
| 9 | + | ``` pascal | |
| 10 | + | procedure TMyForm.Button1Click(Sender: TObject); | |
| 11 | + | begin | |
| 12 | + | ReplaceDialog1.Execute(); | |
| 13 | + | end; | |
| 14 | + | ||
| 15 | + | procedure TMyForm.ReplaceDialog1Replace(Sender: TObject); | |
| 16 | + | var | |
| 17 | + | k: integer; | |
| 18 | + | begin | |
| 19 | + | with Sender as TReplaceDialog do begin | |
| 20 | + | opt := []; | |
| 21 | + | if frReplace in Options then | |
| 22 | + | opt := [ssoReplace]; | |
| 23 | + | if frReplaceAll in Options then | |
| 24 | + | opt := [ssoReplaceAll]; | |
| 25 | + | k := TSynEdit1.SearchReplaceEx( FindText, ReplaceText, opt, Position ); | |
| 26 | + | if k>=0 then | |
| 27 | + | TSynEdit1.SetFocus() | |
| 28 | + | else | |
| 29 | + | Beep(); | |
| 30 | + | end; | |
| 31 | + | end; | |
| 32 | + | ``` | |
| 33 | + | ||
| 34 | + | # Voir aussi | |
| 35 | + | ||
| 36 | + | - [[doc:lcl/dialogs/treplacedialog.html|Doc. TReplaceDialog]] | |
| 37 | + | - [[TFindDialog/fr|TFindDialog]] | |
| 38 | + | ||
| 39 | + | --- | |
| 40 | + | *From the Free Pascal wiki, page "TReplaceDialog/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).* |
