Don't forget add 'ClipBrd' in the uses of your form
From a RichEdit:
procedure TForm1.Button4Click(Sender: TObject);
begin
ClipBoard.SetTextBuf(PChar(RichEdit1.text));
end;
|
or also:
procedure TForm1.Button6Click(Sender: TObject);
begin
RichEdit1.CopyToClipboard;
end;
|
But only copy the selected text
From a string:
procedure TForm1.Button5Click(Sender: TObject);
var
Cadena:string;
begin
Cadena:='Hola mundo/Hello World';
ClipBoard.SetTextBuf(Pchar(Cadena));
end;
|
Sent By: Christian Engstfeld (Christian.Engstfeld@inworx.com.ar)
If the control does not support the message, it is simply ignored, and no exception is raised.
SendMessage(Edit1.handle, WM_COPY, 0, 0);
|
Updated at 15/05/2001
|