Difference between revisions of "Howto Use TOpenDialog/fr"
From Lazarus wiki
Jump to navigationJump to searchPaulatreides (talk | contribs) (New page: {{Howto Use TOpenDialog}} Simple and short guideline: 1. Place the OpenDialog widget on your form (anyplace, since it will be not visible). (It is the left most dialog under Dialog) ...) |
m (Fixed syntax highlighting) |
||
(8 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Howto Use TOpenDialog}} | {{Howto Use TOpenDialog}} | ||
− | + | == Comment utiliser TOpenDialog == | |
− | + | Procédure rapide : | |
− | |||
− | + | 1. Placer le composant '''OpenDialog''' sur votre fiche (n'importe où, puisqu'il ne sera pas visible). | |
+ | [[Image:Component_Palette_Dialogs.png]] | ||
+ | (C'est le dialogue le plus à gauche sous dialogue.) | ||
− | < | + | 2. Dans le code, écrire quelque chose comme : |
+ | |||
+ | <syntaxhighlight lang=pascal> | ||
var filename : string; | var filename : string; | ||
Line 16: | Line 19: | ||
ShowMessage(filename); | ShowMessage(filename); | ||
end; | end; | ||
− | </ | + | </syntaxhighlight> |
+ | |||
+ | La méthode [[doc:lcl/dialogs/tcommondialog.execute.html | Execute]] montre la boîte de dialogue d'ouverture de fichiers. Elle renvoie '''True''' quand l'utilisateur a sélectionné un fichier, '''False''' quand le choix a échoué. | ||
+ | |||
+ | La propriété [[doc:lcl/dialogs/tfiledialog.filename.html | Filename]] renvoie le nom de fichier complet incluant l'unité de disque et le chemin. | ||
− | + | == Voir aussi == | |
− | + | * [[Howto Use TSaveDialog/fr]] | |
+ | * [[Dialogs_tab| Dialogs tab]] |
Latest revision as of 08:48, 17 February 2020
│
Deutsch (de) │
English (en) │
español (es) │
suomi (fi) │
français (fr) │
日本語 (ja) │
polski (pl) │
русский (ru) │
slovenčina (sk) │
Comment utiliser TOpenDialog
Procédure rapide :
1. Placer le composant OpenDialog sur votre fiche (n'importe où, puisqu'il ne sera pas visible).
(C'est le dialogue le plus à gauche sous dialogue.)
2. Dans le code, écrire quelque chose comme :
var filename : string;
if OpenDialog1.Execute then
begin
filename := OpenDialog1.Filename;
ShowMessage(filename);
end;
La méthode Execute montre la boîte de dialogue d'ouverture de fichiers. Elle renvoie True quand l'utilisateur a sélectionné un fichier, False quand le choix a échoué.
La propriété Filename renvoie le nom de fichier complet incluant l'unité de disque et le chemin.