Sign in Join
Wiki copytemporary

TReplaceDialog/zh CN

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

TReplaceDialog 替换内容的控件. 在 Dialogs tab 的 Component Palette.

]]

用法

示例:使用 TReplaceDialog 和 TSynEdit. OnReplace 属性在按下替换按钮后执行.

pascal
uses
SynEditTypes,
var
opt: TSynSearchOptions; 

//......

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 := SynEdit1.SearchReplaceEx( FindText, ReplaceText, opt, Position );
    if k>=0 then
      SynEdit1.SetFocus()
    else
      Form1.Caption := '...';
  end;
end;

参考资料


From the Free Pascal wiki, page "TReplaceDialog/zh CN", as it stood on 2020-05-02 after a change by TyphonFinger, 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 1 person, 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
TyphonFingerCreated page
TyphonFinger

Talk about this page

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