各位大哥JJ
  如何使用DELPHI中的剪贴板,
实现复制等功能啊,再线

解决方案 »

  1.   

    没有人知道吗如用copytoclipboard等等
    但是coptoclipboard不是每个控件都有的属性,所以该怎么办呢?
      

  2.   

    请问怎么样得到剪贴板的信息 (转载)
    发信人: sowhat (小华), 信区: Delphi
    标  题: Re: 请问怎么样得到剪贴板的信息 (转载)
    发信站: BBS 水木清华站 (Sat Nov 27 20:22:40 1999)
    如果只处理文字,那么TEdit之类的编辑组件具有可以直接调用
    的方法如PastFromClipboard。例如:
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      RichEdit1.SelectAll;
      RichEdit1.CopyToClipboard;
      Edit1.Clear;
      Edit1.PasteFromClipboard;
      RichEdit1.SetFocus;
    end;
    如果还要处理图形,那么需要用到预定义的系统对象Clipboard。例如:
    procedure TForm1.PasteButtonClick(Sender: TObject);
    var
      Bitmap: TBitmap;
      begin
      if Clipboard.HasFormat(CF_BITMAP) then { check to see if there is a pictur
    e }
       begin
         Bitmap := TBitmap.Create;  {Create a bitmap to hold the contents of the
     Clipboard}
         try
           Bitmap.Assign(Clipboard); {get the bitmap off the clipboard using Ass
    ign}
           Image.Canvas.Draw(0, 0, Bitmap); {copy the bitmap to the Image}
         finally
           Bitmap.Free;
         end;
       end;
    end;
    【在 lyra (打倒北约) 的大作中提到: 】
    :
     【以下文字转载自 Database 讨论区】
    :
     【原文由 lyra 所发表】
    :
     比如:剪贴板中是否右内容??thanx
    --
    抬起头在天边,低下头在人间;闭上眼是故乡,睁开眼是苍茫。
    抬起头在天边,低下头在人间;转过身是欺骗,走向前是无言。
    ※来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 166.111.10.156]
      

  3.   

    关于剪贴的内容不一定是在TEDIT1中的啊,这个是由鼠标选择的啊,
    怎么可以这么用呢?
      

  4.   

    大多数操作文本的控件都支持seltext属性,无论鼠标怎样选择,都可以得到所选的文字,这样就可以拷到剪切板上。
      

  5.   

    uses clipbrd;
    with ClipBoard do
    begin
    open;
    AsText:=...;
    Close;
    end;