Paste/copy memo's contents

Posted in Clipboard

To paste something from the clipboard, use PasteFromClipboard method of control. To copy something to the clipboard use CopyToClipboard.

procedure TForm1.Button2Click(Sender: TObject);
begin
  Memo1.SelectAll;
  Memo1.CopyToClipboard;
  Memo1.Clear;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Memo2.PasteFromClipboard;
end;