Difference between revisions of "TReplaceDialog/zh CN"
From Free Pascal wiki
Jump to navigationJump to searchTyphonFinger (talk | contribs) (Created page with "{{TReplaceDialog}} '''TReplaceDialog''' Image:treplacedialog.png 替换内容的控件. 在 Dialogs tab 的 Component Palette. image:component-TReplaceDialog.p...") |
(No difference)
|
Revision as of 06:13, 27 April 2020
│
English (en) │
français (fr) │
русский (ru) │
中文(中国大陆) (zh_CN) │
TReplaceDialog 替换内容的控件. 在 Dialogs tab 的 Component Palette.
用法
示例:使用 TReplaceDialog 和 TSynEdit. OnReplace 属性在按下替换按钮后执行.
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;
参考资料