unit Unit1;
interface
uses
Windows, SysUtils, Classes, Forms, StdCtrls, ExtCtrls, Controls ;
type
TForm1 = class(TForm)
Timer1: TTimer;
Label1: TLabel;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Label1.Caption := TimeToStr(Now);
end;
end.
To show the current system time dynamically (that is, a clock), use a Timer and a Label. The Label Caption should be set empty, initially; and set dimensions manually, with Autosize off. Set the Timer's Interval to 1000 milliseconds, so it will increment once per second. Each time the OnTimer event reaches its Interval, it will get the current time with the native Now function, and then rewrite the Label Caption with the current time.
Wednesday, January 5, 2011
Showing The Time Dynamically (Clock)
Wednesday, January 05, 2011
iwan RFID