Jak sprawdzic jak dlugo użytkownik korzysta z programu ?
Należy do funkcji OnTimer komponentu TTimer dodać następuj±cy kod:

procedure TForm1.Timer1Timer(Sender: TObject);
var
X : integer;
begin
X := StrToInt(Label1.Caption) + 1;
if StrToInt(label1.Caption) = 59 then Begin
X := 0;
Y := Y + 1;
Label2.Caption := IntToStr(Y);
end;
if StrToInt(label1.Caption) = 59 then Begin
if StrToInt(label2.Caption) = 59 then Begin
Y := 0;
Label2.Caption := IntToStr(Y);
Z := Z + 1;
label3.Caption := IntToStr(Z);
end;
end;
Label1.Caption := IntToStr(X);
end;


Autorem tekstu jest: Michał Siudziński
http://cpw.net.pl
Materiał dodany przez użytkownika: alphan