ssaavvee Mose 为公用变量
procedure TForm1.StringGrid1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var xx,yy:Integer;
begin
try
StringGrid1.MouseToCell(x,y,xx,yy);
ssaavvee:=StrToInt(StringGrid1.Cells[xx,yy]);
Mose :=1;
except
end;
procedure TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var xx,yy:Integer;
begin
if mose=1 then
try
StringGrid1.MouseToCell(x,y,xx,yy);
StringGrid1.Cells[xx,yy]:=
IntToStr(StrToInt(StringGrid1.Cells[xx,yy])+ssaavvee);
Mose:=0;
except
end;
end;