Sign in Join
Wiki copytemporary

Howto Use TSaveDialog/sk

Deutsch · English · Español · Français · Polski · Slovenčina · Suomi · Русский · 日本語

Používame TSaveDialog

Jednoduchý (a veľmi krátky) návod:

1. Umiestnite ikonku SaveDialog na váš formulár (hocikam, lebo za behu programu sa aj tak nezobrazí).

text
 Image:Component_Palette_Dialogs.png
 (Je to druhá najlavejšia ikonka v záložke Dialogs)

2. Pridajte do formulára komponentu Memo.

3. Pridajte do formulára tlačidlo.

V okne Object Inspector sa zobrazi vlastnosti objektu Button1. Nastavte vlastnosť 'Caption' na 'Save'. Kliknite na záložku Events (udalosti) v okne Object Inspector. Kliknite na malý obdĺžniček napravo od 'OnClick', automaticky sa prenesiete do editoru kódu (Source Editor) s automaticky vytvoreným kúskom kódu. Vložte:

pascal
 procedure TForm1.Button1Click( Sender: TObject );
 begin
   if SaveDialog1.Execute then
    Memo1.Lines.SaveToFile( SaveDialog1.Filename );
 end;

Metóda Execute zobrazí dialógové okno Uložiť súbor. Vráti true, ak užívateľ vyberie súbor, alebo false, ak okno stornuje.

Vlastnosť Filename potom obsahuje názov súboru, vrátane disku a celej cesty.

Pozrite si tiež


From the Free Pascal wiki, page "Howto Use TSaveDialog/sk", 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.

Revision 5, last changed by WikiArchive .

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.

WhenWhoWhat changed
AdammPreklad z angl. originalu
Adamm
VincentText replace - "delphi>" to "syntaxhighlight>" (minor)
TrevFixed syntax highlighting (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.