unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, ExtCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Label1Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
  for i:=0 to ControlCount-1 do
    if (Controls[i] is TEdit) then (Controls[i] as TEdit).Clear;
end;

procedure TForm1.Button2Click(Sender: TObject);
var i:integer;
begin
  for i:=0 to ControlCount-1 do
    if (Controls[i] is TEdit) then //jesli kontrolka jest typu TEdit
     (Controls[i] as TEdit).Text:=IntToStr(Random(10));
end;

procedure TForm1.Label1Click(Sender: TObject);
begin
  if (Sender is Tlabel) then
    (Sender as TLabel).Visible:=false;
end;

end.
