?? unit3.pas
字號:
unit Unit3;
interface
uses
Classes, SysUtils, Graphics, ExtCtrls;
type
Tthread3 = class(TThread)
private
tt: TShape;
f: boolean;
{ Private declarations }
protected
procedure Execute; override;
public
constructor Create(flag: Boolean; lamp: TShape; Ctrl: Boolean); overload;
end;
implementation
uses main;
{ Tthread3 }
constructor Tthread3.Create(flag: Boolean; lamp: TShape; Ctrl: Boolean);
begin
tt := lamp;
f := Ctrl;
Create(flag);
end;
{控制交通燈}
procedure Tthread3.Execute;
var
i: integer;
begin
for i := 1 to 5000 do
begin
if f = true then
begin
tt.Brush.Color := clRed;
f := false;
end
else if f = false then
begin
tt.Brush.Color := clLime;
f := true;
end;
sleep(5000);
end;
{ Place thread code here }
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -