百
百事
Unregistered / Unconfirmed
GUEST, unregistred user!
请大家帮忙看一下这段小程序,我需要的是在间隔3秒钟的时间动态的描绘一个点,但是
它就只隔了三秒之后就把所有的点都描绘出来了,我对TIMER不怎么熟悉,大家请指教!!
先谢谢了!
procedure TForm1.Button1Click(Sender: TObject);
begin
image1.Canvas.MoveTo(0,150);
image1.Canvas.Pen.Width:=3;
image1.Canvas.LineTo(600,150);
image1.Canvas.MoveTo(0,150);
timer1.Enabled:=true;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var i:integer;
begin
timer1.Enabled:=false;
for i:=0 to 60 do
begin
timer1.Enabled:=true;
timer1.Interval:=3000;
image1.Canvas.Pen.Width:=3;
image1.Canvas.Pen.Color:=clred;
image1.Canvas.LineTo(i*10,150);
end;
end;
end.
它就只隔了三秒之后就把所有的点都描绘出来了,我对TIMER不怎么熟悉,大家请指教!!
先谢谢了!
procedure TForm1.Button1Click(Sender: TObject);
begin
image1.Canvas.MoveTo(0,150);
image1.Canvas.Pen.Width:=3;
image1.Canvas.LineTo(600,150);
image1.Canvas.MoveTo(0,150);
timer1.Enabled:=true;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var i:integer;
begin
timer1.Enabled:=false;
for i:=0 to 60 do
begin
timer1.Enabled:=true;
timer1.Interval:=3000;
image1.Canvas.Pen.Width:=3;
image1.Canvas.Pen.Color:=clred;
image1.Canvas.LineTo(i*10,150);
end;
end;
end.