绯
绯红之王
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit2;interfaceuses Classes,ExtCtrls,unit1,SysUtils;type sss = class(TThread) procedure xontime(Sender: TObject);
private { Private declarations } timer1 : ttimer;
protected procedure Execute;
override;
end;
implementationprocedure sss.Execute;
begin
form1.Caption := 'sss';
timer1 := ttimer.Create(form1);
timer1.Interval := 1000;
timer1.Enabled := true;
timer1.OnTimer := xontime;
end;
procedure sss.xontime(Sender: TObject);var x : word;
begin
x :=strtoint(form1.Label1.Caption);
inc(x);
form1.Label1.Caption := inttostr(x);
end;
end.
在form1里面create这个线程,timer就是没有反应求解
private { Private declarations } timer1 : ttimer;
protected procedure Execute;
override;
end;
implementationprocedure sss.Execute;
begin
form1.Caption := 'sss';
timer1 := ttimer.Create(form1);
timer1.Interval := 1000;
timer1.Enabled := true;
timer1.OnTimer := xontime;
end;
procedure sss.xontime(Sender: TObject);var x : word;
begin
x :=strtoint(form1.Label1.Caption);
inc(x);
form1.Label1.Caption := inttostr(x);
end;
end.
在form1里面create这个线程,timer就是没有反应求解