如果只处理文字,那么TEdit之类的编辑组件具有可以直接调用 <br>的方法如PastFromClipboard。例如: <br>procedure TForm1.Button1Click(Sender: TObject); <br>begin <br> RichEdit1.SelectAll; <br> RichEdit1.CopyToClipboard; <br> Edit1.Clear; <br> Edit1.PasteFromClipboard; <br> RichEdit1.SetFocus; <br>end; <br>如果还要处理图形,那么需要用到预定义的系统对象Clipboard。例如: <br>procedure TForm1.PasteButtonClick(Sender: TObject); <br>var <br> Bitmap: TBitmap; <br> begin <br> if Clipboard.HasFormat(CF_BITMAP) then { check to see if there is a pictur <br>e } <br> begin <br> Bitmap := TBitmap.Create; {Create a bitmap to hold the contents of the <br> Clipboard} <br> try <br> Bitmap.Assign(Clipboard); {get the bitmap off the clipboard using Ass <br>ign} <br> Image.Canvas.Draw(0, 0, Bitmap); {copy the bitmap to the Image} <br> finally <br> Bitmap.Free; <br> end; <br> end; <br>end; <br>