Информатика. Программирование в Delphi
216
Timer1.Enabled:=false;
Label2.Caption:='';
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
inc(sec);
if sec>59 then
begin
sec:=0;
inc(min);
end;
if min>59 then
begin
min:=0;
inc(hour);
end;
Label2.Caption:=IntToStr(hour)+':';
if min<10 then
Label2.Caption:=Label2.Caption+'0'+IntToStr(min)+':'
else
Label2.Caption:=Label2.Caption+IntToStr(min)+':';
if sec<10 then
Label2.Caption:=Label2.Caption+'0'+IntToStr(sec)
else
Label2.Caption:=Label2.Caption+IntToStr(sec);
if MediaPlayer1.Position=MediaPlayer1.Length then
begin
Label2.Caption:='';
Timer1.Enabled:=false;
end;
end;
end.