TOpenDialog/zh CN: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: TOpenDialog/zh CN
| Old | New | Line | |
|---|---|---|---|
| 1 | + | **TOpenDialog**  就是打开文件的弹窗,在 [[Dialogs tab]] 的 [[Component Palette]]. | |
| 2 | + | ||
| 3 | + | ``` pascal | |
| 4 | + | procedure TForm1.Button1Click(Sender: TObject); | |
| 5 | + | var | |
| 6 | + | s:String; | |
| 7 | + | begin | |
| 8 | + | try | |
| 9 | + | OpenDialog1.Execute; | |
| 10 | + | s := OpenDialog1.FileName; | |
| 11 | + | Form1.Caption := s; | |
| 12 | + | Memo1.Lines.LoadFromFile(s); | |
| 13 | + | except | |
| 14 | + | on E: Exception do | |
| 15 | + | //ShowMessage( 'Error: '+ E.ClassName + #13#10 + E.Message ); | |
| 16 | + | ShowMessage('忘记选择文件或者选择的文件不存在'); | |
| 17 | + | end; | |
| 18 | + | end; | |
| 19 | + | ``` | |
| 20 | + | ||
| 21 | + | ## 参考资料 | |
| 22 | + | ||
| 23 | + | - [[doc:lcl/dialogs/topendialog.html|TOpenDialog doc]] | |
| 24 | + | - [[Howto Use TOpenDialog]] | |
| 25 | + | - [[TOpenPictureDialog]] | |
| 26 | + | ||
| 27 | + | --- | |
| 28 | + | *From the Free Pascal wiki, page "TOpenDialog/zh CN", as it stood on 2020-05-06 after a change by FTurtle, 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).* |
