Difference between revisions of "Howto Use TOpenDialog/es"

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). Image:Component_Palette_Dialogs.png ...)
 
Line 1: Line 1:
 
{{Howto Use TOpenDialog}}
 
{{Howto Use TOpenDialog}}
  
Simple and short guideline:
+
Guía corta y simple:
  
1. Place the OpenDialog widget on your form (anyplace, since it will be not visible).
+
1. Sitúa el componente OpenDialog en el formulario (en cualquier parte de el ya que no será visible una vez que el programa esté ejecutandose).
  
 
   [[Image:Component_Palette_Dialogs.png]]
 
   [[Image:Component_Palette_Dialogs.png]]
Line 9: Line 9:
 
   (It is the left most dialog under Dialog)
 
   (It is the left most dialog under Dialog)
  
2. In your code write someting similiar to:
+
2. Introducir el código para manejarlo, por ejemplo:
  
 
<pre>
 
<pre>
   var filename : string;
+
   var nombrefichero : string;    
  
   if OpenDialog1.Execute then
+
   if OpenDialog1.Execute then             { Si se ejecuta OpenDialog1 entonces hacer lo siguiente }
 
   begin
 
   begin
     filename := OpenDialog1.Filename;
+
     nombrefichero := OpenDialog1.Filename; { Asignamos a nombrefichero el valor de OpenDialog1.Filename }   
     ShowMessage(filename);
+
     ShowMessage(nombrefichero);           { Mostramos un mensaje conteniendo el valor de nombrefichero }
 
   end;
 
   end;
 
</pre>
 
</pre>

Revision as of 23:40, 16 January 2009

Deutsch (de) English (en) español (es) suomi (fi) français (fr) 日本語 (ja) polski (pl) русский (ru) slovenčina (sk)

Guía corta y simple:

1. Sitúa el componente OpenDialog en el formulario (en cualquier parte de el ya que no será visible una vez que el programa esté ejecutandose).

  Component Palette Dialogs.png
 
  (It is the left most dialog under Dialog)

2. Introducir el código para manejarlo, por ejemplo:

   var nombrefichero : string;     

   if OpenDialog1.Execute then              { Si se ejecuta OpenDialog1 entonces hacer lo siguiente }
   begin
     nombrefichero := OpenDialog1.Filename; { Asignamos a nombrefichero el valor de OpenDialog1.Filename }    
     ShowMessage(nombrefichero);            { Mostramos un mensaje conteniendo el valor de nombrefichero }
   end;

The Execute method displays the file open dialog. It returns true when user has selected a file, false when user has aborted.

The Filename property returns the full filename including drive and path.


See also