Howto Use TSaveDialog/ja
Deutsch · English · Español · Français · Polski · Slovenčina · Suomi · Русский · 日本語
TSaveDialog の使い方

簡単な説明:
1. SaveDialogをFormに配置します。(アイコンは実行時には表示されませんので、Form上のどこにおいても大丈夫です。)
Image:Component_Palette_Dialogs.png
(SaveDialogは「Dialog」タブの左から2番目)2. memoをformに配置します。

3. buttonをformに配置します。

オブジェクトインスペクタに Button1のプロパティが表示されるので, 'Caption'を'Save'に変更します。 オブジェクトインスペクタのイベントタブをクリックし、OnClick の右側のボックスをクリックしてください。 3つのドット(...)が表示されたさらに小さいboxが表れますので、クリックすると自動的にソースエディタのコーディングするべき場所にカーソルが移動します。
4. 下記を参考にコーディングします。
procedure TForm1.Button1Click( Sender: TObject );
begin
if SaveDialog1.Execute then
Memo1.Lines.SaveToFile( SaveDialog1.Filename );
end;Execute メソッドによりファイルを保存するダイアログが表示されます。 ファイルが選ばれたときはtrueが返値となり、キャンセルしたときはfalseが返値となります。
Filename プロパティは、ドライブ名とパスを含んだファイル名(ファイルへのフルパス) を返り値とします。
関連項目
From the Free Pascal wiki, page "Howto Use TSaveDialog/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.
Edited on wiki.freepascal.org by 3 people, 2008–2020
From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.
| When | Who | What changed |
|---|---|---|
| Miyatakejiro | New page: {{Howto Use TSaveDialog}} {{Japanese Menu}} Image:tsavedialog.png シンプルなガイドライン: 1. SaveDialogのウィジェットをFormに配置する(不可視のウィ... | |
| Miyatakejiro | ||
| Miyatakejiro | ||
| Miyatakejiro | ||
| Miyatakejiro | ||
| Yuichiro Takahashi | ||
| Trev | Fixed syntax highlighting; deleted category included in page template (minor) |
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
