Howto Use TOpenDialog/ja: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | TOpenDialog の使い方 | |
| 2 | 2 | ||
| 3 | 3 |  | |
| 4 | 4 | ||
| 5 | 5 | 簡単な説明: | |
| 6 | 6 | ||
| 7 | 7 | 1\. OpenDialogをFormに配置します。(アイコンは実行時には表示されませんので、Form上のどこにおいても大丈夫です。) | |
| 8 | 8 | ||
| 9 | - | ||
| 10 | - | ||
| 9 | + | ```text | |
| 10 | + | Image:Component_Palette_Dialogs.png | |
| 11 | + | (OpenDialogは「Dialog」タブの左端) | |
| 12 | + | ``` | |
| 11 | 13 | ||
| 12 | 14 | 2\. 下記を参考にコーディングします。 | |
| 13 | 15 | ||
| 14 | 16 | ``` pascal | |
| 15 | 17 | var filename : string; | |
| 16 | 18 | ||
| 17 | 19 | if OpenDialog1.Execute then | |
| 18 | 20 | begin | |
| 19 | 21 | filename := OpenDialog1.Filename; | |
| 20 | 22 | ShowMessage(filename); | |
| 21 | 23 | end; | |
| 22 | 24 | ``` | |
| 23 | 25 | ||
| 24 | 26 | [[doc:lcl/dialogs/tcommondialog.execute.html|Executeメソッドによりファイルを]]開くダイアログが表示されます。 ファイルが選ばれたときは [[True|true]] が返り値となり、キャンセルしたときは [[False|false]] が返り値となります。 | |
| 25 | 27 | ||
| 26 | 28 | [[doc:lcl/dialogs/tfiledialog.filename.html|Filenameプロパティは]]、 ドライブ名とパスを含んだファイル名(ファイルへのフルパス)を返り値とします。 | |
| 27 | 29 | ||
| 28 | 30 | ## 関連項目 | |
| 29 | 31 | ||
| 30 | 32 | - [[Howto Use TSaveDialog/ja|TSaveDialog の使い方]] | |
| 31 | 33 | - [[Dialogs tab/ja|Dialogs タブ]] | |
| 32 | 34 | ||
| 33 | 35 | --- | |
| 34 | 36 | *From the Free Pascal wiki, page "Howto Use TOpenDialog/ja", as it stood on 2020-02-17 after a change by Trev, 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).* |
