unit uCountdown;

interface

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

type
  TCount = class(TForm)
    Zaehle: TButton;
    Zahl: TLabel;
    Ende: TButton;
    procedure ZaehleClick(Sender: TObject);
    procedure EndeClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Count: TCount;

implementation

procedure pause(zeit:LongInt);
var anfang:LongInt;
 begin anfang:=GetTickCount;
       while GetTickCount<anfang+zeit do
       Application.ProcessMessages;
 end;

{$R *.DFM}

procedure TCount.ZaehleClick(Sender: TObject);
var i : integer;
    ausgabe : string;
begin
  zaehle.visible := false;
  zahl.visible:= true;
  for i:=10 downto 0 do
  begin;
     zahl.caption := IntToStr(i);
     pause(1000);
  end;
  Count.color :=clBtnFace;
  zahl.visible:= false;
  zaehle.visible := true;
  ende.visible:= true;
end;

procedure TCount.EndeClick(Sender: TObject);
begin
   close;
end;

end.
