procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);var p :TPoint;begin GetCursorPos(p); ScreenToClient(p); if Button in [mbRight] then begin //p.X := X; //p.Y := Y; if (X >= DBGrid1.Left) and (X <= DBGrid1.Left+DBGrid1.Width) and (Y >= DBGrid1.Top) and (Y <= DBGrid1.Height + DBGrid1.Top) then begin PopupMenu1.Popup(p.X,p.Y); end; end;end;