{Private declarations}
public
{Public declarations}
end;
var
Form1: TForm1;
A, k: integer;
implementation
uses Unit2, unit6, Unit3;
{$ R *. dfm}
procedure TForm1.N2Click (Sender: TObject);
begin
AboutBox.ShowModal;
end;
procedure TForm1.N4Click (Sender: TObject);
begin
close;
end;
procedure TForm1.Button1Click (Sender: TObject);
begin
k: = StrToInt (edit1.Text);
if (k <= 3) or (k> 30)
then ShowMessage ('Не вірно задано значення')
else
begin
k: = StrToInt (edit1.Text);
Form2.StringGrid1.ColCount: = (k +1);
Form2.visible: = true;
Form1.visible: = false;
end;
Form2.StringGrid1.Cells [0,0]: = 'X';
Form2.StringGrid1.Cells [0,1]: = 'Y';
end;
procedure TForm1.Edit1KeyPress (Sender: TObject; var Key: Char);
begin
if not (key in ['0 '.. '9']) then key: = # 0;
end;
end.
_
В
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, Menus;
type
TForm2 = class (TForm)
Label3: TLabel;
Button1: TButton;
Label5: TLabel;
MainMenu1: TMainMenu;
N1: TMenuItem;
N4: TMenuItem;
N2: TMenuItem;
StringGrid1: TStringGrid;
Label1: TLabel;
Button2: TButton;
procedure Button1OnClick (Sender: TObject);
procedure Button2OnClick (Sender: TObject);
procedure N4Click (Sender: TObject);
procedure N2Click (Sender: TObject);
procedure StringGrid1KeyPress (Sender: TObject; var Key: Char);
private
{Private declarations}
public
{Public declarations}
end;
var
Form2: TForm2;
I, J: Integer;
implementation
uses Unit1, Unit6, Unit3;
{$ R *. dfm}
procedure TForm2.N4Click (Sender: TObject);
begin
close;
Form1.Close;
end;
procedure TForm2.Button1OnClick (Sender: TObject);
begin
Form3.visible: = true;
Form2.visible: = false;
end;
procedure TForm2.Button2OnClick (Sender: TObject);
begin
Form1.visible: = true;
Form2.visible: = false;
end;
procedure TForm2.N2Click (Sender: TObject);
begin
AboutBox.ShowModal;
end;
procedure TForm2.StringGrid1KeyPress (Sender: TObject; var Key: Char);
begin
if not (key in ['0 '.. '9...