Sign in Join
Wiki copytemporary

TReplaceDialog/fr

English · Français · Русский · 中文(中国)

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. .

]]

Usage

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é.

pascal
procedure TMyForm.Button1Click(Sender: TObject);
begin
  ReplaceDialog1.Execute();
end;

procedure TMyForm.ReplaceDialog1Replace(Sender: TObject);
var
  k: integer;
begin
  with Sender as TReplaceDialog do begin
    opt := []; 
    if frReplace in Options then
      opt := [ssoReplace]; 
    if frReplaceAll in Options then
      opt := [ssoReplaceAll]; 
    k := TSynEdit1.SearchReplaceEx( FindText, ReplaceText, opt, Position );
    if k>=0 then
      TSynEdit1.SetFocus()
    else
      Beep();
  end;
end;

Voir aussi


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.

Revision 1, last changed by WikiArchive .

Edited on wiki.freepascal.org by 2 people, 2017–2020

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
E-ricCreated page
TrevFixed syntax highlighting (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.