首页 > 编程学习 > cxgrid复制粘贴操作

cxgrid复制粘贴操作

发布时间:2022/5/14 18:47:28

1、uses clipbrd;
2、复制
procedure TForm1.cxButton1Click(Sender: TObject);
var
p1,p2:integer;
p3:string;
begin
p1:=cxGrid5DBTableView1.Controller.FocusedRowIndex;
p2:=cxGrid5DBTableView1.Controller.FocusedColumnIndex;
p3:=cxGrid5DBTableView1.DataController.Values[p1,p2];
showmessage(inttostr(p1)+','+inttostr(p2)+','+p3);
clipboard.AsText:=p3;
3.粘贴
procedure TForm1.cxButton1Click(Sender: TObject);
begin
keybd_event(VK_Control, MapVirtualKey(VK_Control, 0), 0, 0);
keybd_event(ord('C'), MapVirtualKey(ord('C'), 0), 0, 0);
keybd_event(ord('C'), MapVirtualKey(ord('C'), 0), KEYEVENTF_KEYUP, 0);
keybd_event(VK_Control, MapVirtualKey(VK_Control, 0), KEYEVENTF_KEYUP,0);
end;

Copyright © 2010-2022 ngui.cc 版权所有 |关于我们| 联系方式| 豫B2-20100000