cxgrid复制粘贴操作
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;