是不是这样效果?procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var p: TPoint; begin if gdSelected in State then begin p := DBGrid1.ClientToScreen(Point(Rect.Left, Rect.Top)); SetCursorPos(p.X, p.Y); end; end;
www.51delphi.com
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
p: TPoint;
begin
if gdSelected in State then
begin
p := DBGrid1.ClientToScreen(Point(Rect.Left, Rect.Top));
SetCursorPos(p.X, p.Y);
end;
end;