unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, ComCtrls, StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    Edit1: TEdit;
    BitBtn1: TBitBtn;
    UpDown1: TUpDown;
    Button1: TButton;
    procedure UpDown1Changing(Sender: TObject; var AllowChange: Boolean);
    procedure BitBtn1Click(Sender: TObject);
    procedure Edit1Change(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.UpDown1Changing(Sender: TObject;
  var AllowChange: Boolean);
begin
stringgrid1.RowCount:=updown1.Position;
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
var
i,j,k:integer;
begin
randomize;
for i:=1 to updown1.Position do
for j:= 0 to 20 do     
begin
k:=random(90)+1;
stringgrid1.Cells[j,i-1]:=inttostr(k);
end;
end;

procedure TForm1.Edit1Change(Sender: TObject);
begin
stringgrid1.RowCount:=updown1.Position;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
form1.WindowState:=wsmaximized
end;

procedure TForm1.FormCreate(Sender: TObject);
begin

form1.Canvas.TextOut(5,10,'Lottószám generálása!');
end;

end.
