Recent

Author Topic: Memo1.CopyToClipboard  (Read 15306 times)

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: Memo1.CopyToClipboard
« Reply #15 on: July 07, 2013, 12:29:59 pm »
(Actually, with this method it's not necessary to have the first and third lines at all. Clipboard.AsText := Memo1.Text is all that's needed.)

Yes, sure. Sorry.
I meant sth. like this:

Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
  Memo1.SelStart:=5;
  Memo1.SelLength:=10;
  Application.ProcessMessages;
  Clipboard.AsText:=Memo1.SelText;
  Memo1.SelLength := 0;
end;     


This works here.

eric

  • Sr. Member
  • ****
  • Posts: 267
Re: Memo1.CopyToClipboard
« Reply #16 on: July 07, 2013, 01:39:36 pm »
Yes, that works in the general case. For my present purposes I just need to copy all the text in the TMemo.

 

TinyPortal © 2005-2018