维基副本镜像

这是 pascal.chat 维基的镜像。编辑、历史记录和登录都在那里。

TSaveDialog/zh CN

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

TSaveDialog 是保存文件的对话框. 控件在 Dialogs tab 的 Component Palette.

此控件为不可见控件,拖放到 form 窗体,然后使用方法 .Execute() 调用.

pascal
procedure TForm1.Button1Click(Sender: TObject);
var
  myfPath: string;
begin
  try
    try
      SaveDialog1.Execute;
      myfPath := SaveDialog1.FileName;
      Memo1.Lines.SaveToFile(myfPath);
      Exit;
    except
      ShowMessage('程序异常,请重新保存');
    end;
  finally
    //无论如何都会执行
    ShowMessage('me');
  end;

end;

参考资料


From the Free Pascal wiki, page "TSaveDialog/zh CN", as it stood on 2020-05-01 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.

版本1,最后由WikiArchive于修改。