unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Borland.Vcl.ExtCtrls, Borland.Vcl.StdCtrls, System.ComponentModel;
type
TForm3 =
class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Button1: TButton;
Button2: TButton;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Button3: TButton;
Timer1: TTimer;
Label5: TLabel;
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form3: TForm3;
implementation
{$R *.nfm}
procedure TForm3.Button1Click(Sender: TObject);
var H,M,S,SZ:Integer;
begin
H:= 60*60*StrtoInt(Edit1.Text);
M:= 60*StrtoInt(Edit2.Text);
S:= StrtoInt(Edit3.Text);
SZ:=H+M+S;
Label5.Caption:=IntToStr(SZ);
Timer1.Enabled := true;
Button1.Enabled:=false;
Button3.Enabled:=true;
end;
procedure TForm3.Timer1Timer(Sender: TObject);
var sekunden,minuten,Stunden :Real;
S1,EM,ES,EH,H,M,S: Integer;
begin
S:=StrtoInt(Label5.caption)-1;
Label5.caption:=InttoStr(S);
S1:=StrtoInt(Label5.caption);
Stunden:=(S1)/60/60;
minuten:=(stunden-Trunc(stunden))*60;
sekunden:=(minuten-Trunc(minuten))*60;
EH:=trunc(Stunden);
EM:=Trunc(MInuten);
ES:=Trunc(Sekunden);
Label1.caption:=InttoStr(EH)+'
:'+InttoStr(EM)+'
:'+InttoStr(ES);
end;
procedure TForm3.Button3Click(Sender: TObject);
begin
Button1.Enabled:=true;
Button3.Enabled:=false;
Timer1.Enabled:=false;
Label5.Caption:='
00:00:00';
Edit1.Text:='
00';
Edit2.Text:='
00';
Edit3.Text:='
00';
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
if Timer1.Enabled=true
then
Timer1.Enabled:=false;
if Timer1.Enabled=false
then
Timer1.Enabled:=true;
end;
end.