uses Unit2;
{$R *.DFM}
//Выход
procedure TForm1.N2Click(Sender: TObject);
begin
IF MessageDlg('Вы действительно хотите выйти',mtInformation,mbYesNoCancel, 0)=mrYes THEN
Close;
end;
//Вернуться
procedure TForm1.N3Click(Sender: TObject);
begin
BitBtn2.Enabled:=False;
Form1.Height:=StringGrid1.Height+14 0;
Form1.Width:=StringGrid1.Width+440;
Form1.Position:=poScreenCenter;
StringGrid2.Visible:=false;
StringGrid1.Visible:=true;
Label3.Enabled:=True;
end;
//Очистить
procedure TForm1.N6Click(Sender: TObject);
begin
FOR i:=1 TO StringGrid1.ColCount DO
FOR j:=1 TO StringGrid1.RowCount DO
begin
StringGrid1.Cells[i,j]:='';
end;
end;
//Размер увеличить
procedure TForm1.N8Click(Sender: TObject);
begin
a:=Form1.Height;
b:=Form1.Width;
Form1.Height:=a+10;
Form1.Width:=b+10;
end;
//О программе
procedure TForm1.N10Click(Sender: TObject);
begin
form2.Show;
end;
//Тестирование
procedure TForm1.N11Click(Sender: TObject);
begin
IF n=7 THEN
begin
N11.Enabled:=True;
N17.Enabled:=True;
BitBtn5.Enabled:=True;
StringGrid1.Cells[3,1]:=IntToStr(2);
StringGrid1.Cells[2,1]:=IntToStr(4);
StringGrid1.Cells[4,1]:=IntToStr(6);
StringGrid1.Cells[3,2]:=IntToStr(8);
StringGrid1.Cells[5,3]:=IntToStr(7);
StringGrid1.Cells[5,4]:=IntToStr(18);
StringGrid1.Cells[7,5]:=IntToStr(20);
StringGrid1.Cells[6,4]:=IntToStr(3);
StringGrid1.Cells[7,6]:=IntToStr(11);
end;
IF n=8 THEN begin
N11.Enabled:=True;
N17.Enabled:=True;
BitBtn5.Enabled:=True;
StringGrid1.Cells[2,1]:=IntToStr(12);
StringGrid1.Cells[3,1]:=IntToStr(13);
StringGrid1.Cells[4,2]:=IntToStr(5);
StringGrid1.Cells[5,2]:=IntToStr(7);
StringGrid1.Cells[4,3]:=IntToStr(8);
StringGrid1.Cells[6,3]:=IntToStr(9);
StringGrid1.Cells[5,4]:=IntToStr(1);
StringGrid1.Cells[7,4]:=IntToStr(4);
StringGrid1.Cells[7,5]:=IntToStr(6);
StringGrid1.Cells[7,6]:=IntToStr(11);
StringGrid1.Cells[8,6]:=IntToStr(14);
StringGrid1.Cells[8,7]:=IntToStr(17);
end;
IF n=14 THEN begin
N11.Enabled:=True;
N17.Enabled:=True;
BitBtn5.Enabled:=True;
StringGrid1.Cells[2,1]:=IntToStr(7);
StringGrid1.Cells[3,1]:=IntToStr(4);
StringGrid1.Cells[4,1]:=IntToStr(7);
StringGrid1.Cells[4,2]:=IntToStr(5);
StringGrid1.Cells[6,2]:=IntToStr(5);
StringGrid1.Cells[5,3]:=IntToStr(10);
StringGrid1.Cells[8,3]:=IntToStr(4);
StringGrid1.Cells[5,4]:=IntToStr(6);
StringGrid1.Cells[6,4]:=IntToStr(3);
StringGrid1.Cells[10,4]:=IntToStr(10);
StringGrid1.Cells[7,5]:=IntToStr(7);
StringGrid1.Cells[8,5]:=IntToStr(3);
StringGrid1.Cells[10,6]:=IntToStr(4);
StringGrid1.Cells[11,6]:=IntToStr(9);
StringGrid1.Cells[9,7]:=IntToStr(8);
StringGrid1.Cells[10,7]:=IntToStr(6);
StringGrid1.Cells[9,8]:=IntToStr(5);
StringGrid1.Cells[12,8]:=IntToStr(4);
StringGrid1.Cells[13,9]:=IntToStr(9);
StringGrid1.Cells[11,10]:=IntToStr(7);
StringGrid1.Cells[13,10]:=IntToStr(10);
StringGrid1.Cells[14,11]:=IntToStr(8);
StringGrid1.Cells[13,12]:=IntToStr(9);
StringGrid1.Cells[14,12]:=IntToStr(6);
StringGrid1.Cells[14,13]:=IntToStr(5);
end;
end;