顺便还把单元格给变了:
procedure TFGLGL.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
MousePos: TSmallPoint;
begin
if Button = mbRight then
begin
MousePos.x := x;
MousePos.y := y;
SendMessage(StringGrid1.Handle, WM_LBUTTONDOWN, , MAKELONG(x, y));
SendMessage(StringGrid1.Handle, WM_LBUTTONUP, , MAKELONG(x, y));
end;
end;
参考:http://www.cnblogs.com/lovemoon714/archive/2012/06/25/2561187.html