Paste text from ClipBoard  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 05/08/99

Tip accessed 493 times

 


  • Add 'ClipBrd' in the uses of your form
  • Put a TRichEdit (RichEdit1) and a TButton (Button1) in your form
  • Put this code in the OnClick of Button1:



     procedure TForm1.Button1Click(Sender: TObject);
     begin
       if Clipboard.HasFormat(CF_TEXT)
         then RichEdit1.Text := Clipboard.AsText
         else ShowMessage('No hay texto en el PortaPapeles/There is no text on the Clipboard');
     end;
    



    With a RichEdit, we could also make:


     procedure TForm1.Button1Click(Sender: TObject);
     begin
       if Clipboard.HasFormat(CF_TEXT)
         then RichEdit1.PasteFromClipboard
         else ShowMessage('No hay texto en el PortaPapeles/There is no text on the Clipboard');
     end;