我用以下的程序运行的结果是:当我在表头中按下鼠标右键时弹出菜单。
而我是想在某条记录的某个字段中按下鼠标右键时,弹出菜单;请问
各位大虾,该怎么改?谢谢!procedure TfrmMain.DBGrid1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
clientpoint,screenpoint:Tpoint;begin
if button=mbright then
begin
clientpoint.x:=x;
clientpoint.y:=y;
screenpoint:=dbgrid1.ClientToScreen(clientpoint);
inc(clickcount);
if odd(clickcount) then
popupmenu2.Popup(screenpoint.x,screenpoint.y);
end;
end;
而我是想在某条记录的某个字段中按下鼠标右键时,弹出菜单;请问
各位大虾,该怎么改?谢谢!procedure TfrmMain.DBGrid1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
clientpoint,screenpoint:Tpoint;begin
if button=mbright then
begin
clientpoint.x:=x;
clientpoint.y:=y;
screenpoint:=dbgrid1.ClientToScreen(clientpoint);
inc(clickcount);
if odd(clickcount) then
popupmenu2.Popup(screenpoint.x,screenpoint.y);
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货