procedure TForm1.ButtonFirstClick(Sender: TObject);
var i,j,n:integer;
begin
StringGridFirst.FixedRows := 0;
StringGridFirst.FixedCols := 0;
Randomize;
StringGridFirst.ColCount:=2+Random(8);
StringGridFirst.RowCount:=2+Random(8);
n:=1;
for i:=0 to StringGridFirst.ColCount -1 do
for j:=0 to StringGridFirst.ColCount -1 do
begin
StringGridFirst.Cells[i,j]:=FloatToStr (power( ( 2*sqr(n)+3 )/( sqr(n)+4),n));
Inc(n);
end;
end;
procedure TForm1.StringGridFirstMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
Var i,j,nc,nr:integer;
begin
StringGridFirst.MouseToCell(X,Y,nc,nr);
if (nc> StringGridFirst.ColCount-1) or (nr > StringGridFirst.ColCount-1) or
(nc<0) or (nr<0) then
begin
ShowMessage ('Неверное указание ячейки');
exit;
end;
begin
{}
StringGridStr.RowCount:=1;
case Button of
mbleft:begin
StringGridStr.ColCount:=StringGridFirst.ColCount;
for i:=0 to StringGridStr.ColCount -1 do
StringGridStr.Cells[i,0]:=StringGridFirst.Cells[i,StringGridFirst.Row];
end;
mbRight:begin
StringGridStr.ColCount:=StringGridFirst.RowCount;
for i:=0 to StringGridStr.ColCount -1 do
StringGridStr.Cells[i,0]:=StringGridFirst.Cells[StringGridFirst.Col,i];
end;
end;
end;
end;
end.
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.