procedure Tfrmpb.sg1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
sg1.MouseToCell(X, Y, iLeft, iTop);
end;
procedure Tfrmpb.sg1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
SS: TGridRect;
begin
if iLeft<0 then Exit;
sg1.MouseToCell(X, Y, iRight, iButtom);
SS.Left:=iLeft;
SS.Top:=iTop;
SS.Right:=iRight;
SS.Bottom:=iButtom;
sg1.Selection:=SS;
end;
procedure Tfrmpb.sg1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
iLeft:=-1;
end;