0

Hi please help me.

On my form i have a memo and 2 buttons, one is to load a .txt file into the form the other is to save.

I want to use these buttons using the VistaSave and load dialogs.

The save button i want to take the contents of Memo1 and save it to a .txt file.

the load button i want to take the contents of a .txt file and write it to the Memo1.

Please could you help me do this.

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by FlamingClaw
0

Use the SaveDialog and OpenDialog. That uses the Win32 API to open up the default browsers.

procedure TDatabaseBackupFm.ButtonSaveFileClick(Sender: TObject);
begin
  if SaveDialog1.Execute then
    Memo1.Lines.SaveToFile(SaveDialog1.FileName);

The SaveDialog should be in your toolbox.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.