Friday, October 5, 2007

How to program with the SaveDialog

How to program with the SaveDialog

To program with the SaveDialog

Step 1

To program with SaveDialog, first, double click the Save File button.

Step 2

Next, it will display a Code Explore window and you need to enter the programming inside it.

Step 3

Program:

procedure TForm1.SaveAs1Click(Sender:TObject);

begin

savedialog1.filename:=tFilename;

if SaveDialog1.Execute then

Begin

tFilename:=SaveDialog1.Filename;

Caption:=ExtractFileName(tFilename);

SaveFileClick(sender);

end;

end;

procedure TForm1.SaveFileClick(Sender: TObject);

begin

if OpenDialog1.FileName <> '' then

Begin

Memo1.Lines.SaveToFile(OpenDialog1.Filename);

End

else

SaveAs1Click(sender)

end;

end.

Tips:

and

No comments: