在你的stringgrid里的OnMouseDown事件里加上如下代码: procedure TForm1.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var NewLparame:DWord; begin if (Button=mbRight) then begin NewLparame:=((Dword(y) shl 16)) or dword(x); postmessage(StringGrid1.Handle,WM_LBUTTONDOWN,MK_LBUTTON,NewLparame); postmessage(StringGrid1.Handle,WM_LBUTTONUP,MK_LBUTTON,NewLparame); end; end;
procedure TForm1.StringGrid1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
NewLparame:DWord;
begin
if (Button=mbRight) then
begin
NewLparame:=((Dword(y) shl 16)) or dword(x);
postmessage(StringGrid1.Handle,WM_LBUTTONDOWN,MK_LBUTTON,NewLparame);
postmessage(StringGrid1.Handle,WM_LBUTTONUP,MK_LBUTTON,NewLparame);
end;
end;