Sign in Join
Wiki copytemporary

TSaveDialog/zh CN: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: TSaveDialog/zh CN

OldNewLine
1+**TSaveDialog** ![](/wiki-images/e/e1/Tsavedialog.png) 是保存文件的对话框. 控件在 [[Dialogs tab]] 的 [[Component Palette]].
2+
3+此控件为不可见控件,拖放到 [[TForm|form]] 窗体,然后使用方法 `.Execute()` 调用.
4+
5+``` pascal
6+procedure TForm1.Button1Click(Sender: TObject);
7+var
8+ myfPath: string;
9+begin
10+ try
11+ try
12+ SaveDialog1.Execute;
13+ myfPath := SaveDialog1.FileName;
14+ Memo1.Lines.SaveToFile(myfPath);
15+ Exit;
16+ except
17+ ShowMessage('程序异常,请重新保存');
18+ end;
19+ finally
20+ //无论如何都会执行
21+ ShowMessage('me');
22+ end;
23+
24+end;
25+```
26+
27+## 参考资料
28+
29+- [[Howto Use TSaveDialog]]
30+- [[doc:lcl/dialogs/tsavedialog.html|TSaveDialog doc]]
31+- [[TSavePictureDialog]]
32+
33+---
34+*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](/wiki-contact).*

Back to history