Mirror

Copy your form to the clipboard (Views: 100)


Problem/Question/Abstract:

Put the form contents in the clipboard.

Answer:

Add 'Clipbrd' in the uses of your form
Put this code in the OnClick of a TButton

procedure TForm1.Button1Click(Sender: TObject);
var bitmap:tbitmap;
begin
  bitmap:=tbitmap.create;
  bitmap.width:=clientwidth;
  bitmap.height:=clientheight;
  try
    with bitmap.Canvas do
      CopyRect (clientrect,canvas,clientrect);
    clipboard.assign(bitmap);
  finally
    bitmap.free;
  end;
end;

<< Back to main page