Sign in Join
Wiki copytemporary

Howto Use TSaveDialog/es

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

Como utilizar el diálogo TSaveDialog

   Guía simple:

   1. Colocar un componente TSaveDialog en tu formulario (en cualquier lugar del mismo, ya que en tiempo de ejecución no será visible).

text
Image:Lazarus_Paleta_Dialogos.png
 (Es el segundo elemento a la izquierda bajo  Pestaña Dialogs)

   2. Añadir un memo en el formulario.

   3. Añadir un botón en el formulario.

   El Object Inspector mostrará las propiedades del objeto Button1.

   Cambia la propiedad llamada Caption, del valor mostrado ('Button1') a 'Guardar', u otro que consideres apropiado.

   Haz clic en la pestaña Eventos del Inspector de Objetos. Selecciona el rectángulo situado a la derecha de OnClick: aparece un pequeño cuadro con tres puntos (... elipsis). Haz clic en ella, automáticamente se abrirá el editor de código fuente y el cursor se ubicará en un trozo de código de comienzo, la plantilla del método de respuesta al evento.

Completa el código:

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

   El método Execute muestra el diálogo para salvar ficheros. Retorna true cuando el usuario selecciona un fichero, y false cuando el usuario cancela la operación.

   La propiedad Filename retorna el nombre de fichero completo incluyendo la unidad y la ruta.

Ver además


From the Free Pascal wiki, page "Howto Use TSaveDialog/es", 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 3, last changed by WikiArchive .

Edited on wiki.freepascal.org by 5 people, 2009–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
Jma spNew page: {{Howto Use TSaveDialog}} Howto Use TSaveDialog Image:tsavedialog.png Simple guideline: 1. Place the SaveDialog widget on your form (anyplace, since it will be not visible). [[I...
Jma sp
Jma spVer además
Jma sp
Jma sp
Jma sp
Iskraelectrica
Iskraelectrica
Iskraelectrica (minor)
IskraelectricaVer además (minor)
Iskraelectrica (minor)
VincentText replace - "delphi>" to "syntaxhighlight>" (minor)
FTurtle
TrevFixed syntax highlighting (minor)

Talk about this page

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