Difference between revisions of "Howto Use TOpenDialog/fr"

From Lazarus wiki
Jump to navigationJump to search
(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}}
  
Simple and short guideline:
+
== Comment utiliser TOpenDialog ==
  
1. Place the OpenDialog widget on your form (anyplace, since it will be not visible).
+
Procédure rapide :
  (It is the left most dialog under Dialog)
 
  
2. In your code write someting similiar to:
+
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.)
  
<pre>
+
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;
</pre>
+
</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.
  
The [[doc:lcl/dialogs/tcommondialog.execute.html | Execute]] method displays the file open dialog. It returns true when user has selected a file, false when user has aborted.
+
== Voir aussi ==
  
The [[doc:lcl/dialogs/tfiledialog.filename.html | Filename]] property returns the full filename including drive and path.
+
* [[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).

 Component Palette Dialogs.png
 (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.

Voir aussi