Programalama > DELPHI

Etiketler: trafik, lambasi

Ort. 1
Puan ver:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls;

type
  TForm1 = class(TForm)
    Shape1: TShape;
    Shape2: TShape;
    Shape3: TShape;
    Timer1: TTimer;
    Timer2: TTimer;
    Timer3: TTimer;
    Bevel1: TBevel;
    procedure Timer3Timer(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Timer3Timer(Sender: TObject);
begin
timer1.Enabled:=true;
timer3.Enabled:=false;
timer2.Enabled:=false;
shape3.Brush.Color:=clgray;
shape1.Brush.Color:=clred;
shape2.Brush.Color:=clgray;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
timer2.Enabled:=true;
timer3.Enabled:=false;
timer1.Enabled:=false;
shape1.Brush.Color:=clgray;
shape2.Brush.Color:=clyellow;
shape3.Brush.Color:=clgray;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
timer1.Enabled:=false;
timer3.Enabled:=true;
timer2.Enabled:=false;
shape3.Brush.Color:=clgreen;
shape2.Brush.Color:=clgray;
shape2.Brush.Color:=clgray;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
timer1.Enabled:=true;

end;

end.


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.