procedure TForm1.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var ACol, ARow: integer; begin if Button=mbRight then begin StringGrid1.MouseToCell(x, y, ACol, ARow); StringGrid1.cells[ACol, ARow] := '测试'; end; end;
begin
TStringGrid(PopupMenu1.PopupComponent).cells[0, 0] := '测试';
end;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
ACol, ARow: integer;
begin
if Button=mbRight then
begin
StringGrid1.MouseToCell(x, y, ACol, ARow);
StringGrid1.cells[ACol, ARow] := '测试';
end;
end;