Sign in Join
Wiki copytemporary

Howto Use TSaveDialog/fr: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11== Comment utiliser **TSaveDialog ==** ![](/wiki-images/e/e1/Tsavedialog.png)
22
33Guide rapide :
44
551\. Placer un composant **SaveDialog** sur une fiche (peu importe où puisqu'il ne sera pas visible).
66
7-` `![`Component_Palette_Dialogs.png`](/wiki-images/7/72/Component_Palette_Dialogs.png)\
8-` (Il s'agit du second composant en partant de la gauche sous `[[Dialogs tab]]`)`
7+```text
8+ Image:Component_Palette_Dialogs.png
9+ (Il s'agit du second composant en partant de la gauche sous Dialogs tab)
10+```
911
10122\. Ajouter un composant **Memo** sur la fiche.
1113
1214![](/wiki-images/1/1b/Tmemo.png)
1315
14163\. Ajouter un bouton sur la fiche.
1517
1618![](/wiki-images/b/b2/Tbutton.png)
1719
1820L'inspecteur d'objet affichera les propriétés du bouton **Button1**. Modifier la propriété nommée **Caption** : de **Button1**, la passer à **Enregistrer**. Cliquer sur le panneau **Événements** de l'inspecteur d'objet. Cliquer à droite de **OnClick** : une petite boîte comprenant trois points apparaît. Cliquer sur cette petite boîte qui conduit directement dans l'éditeur de source, plaçant au passage le curseur au début d'une portion de code ajoutée automatiquement. Compléter ainsi le code :
1921
2022``` pascal
2123 procedure TForm1.Button1Click( Sender: TObject );
2224 begin
2325 if SaveDialog1.Execute then
2426 Memo1.Lines.SaveToFile( SaveDialog1.Filename );
2527 end;
2628```
2729
2830La méthode [[doc:lcl/dialogs/tcommondialog.execute.html|Execute]] affichera la boîte de dialogue de choix d'un fichier. Elle retourne [[True/fr|true]] quand l'utilisateur a choisi un fichier et [[False/fr|false]] quand il a abandonné la procédure.
2931
3032La propriété [[doc:lcl/dialogs/tfiledialog.filename.html|Filename]] retournera le nom du fichier choisi en incluant le lecteur et le chemin.
3133
3234## Voir aussi
3335
3436- [[Howto Use TOpenDialog/fr]]
3537- [[Dialogs tab]]
3638- [[Standard tab|TButton]]
3739- [[Standard tab|TMemo]]
3840
3941---
4042*From the Free Pascal wiki, page "Howto Use TSaveDialog/fr", 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).*

Back to history