30-03-2015, 04:19 PM
دلفي xe2
كود :
unit Unit15;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls;
type
TForm15 = class(TForm)
Shape1: TShape;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form15: TForm15;
c : array [1..4] of Tcolor = (clred,clblue,clgreen,clwhite);
i : integer=1;
implementation
{$R *.dfm}
procedure TForm15.Timer1Timer(Sender: TObject);
begin
shape1.Brush.Color:=c[i];
i:=i+1;
if i=5 then i:=1;
end;
end.
