遵义铝业:Delphi高手进,有问题问

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/18 13:46:33
小弟没学过delphi,但老师布置的作业用Delphi做是最简单的,所以是现学现做,想问个问题
1.
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Image1.Left:=(Image1.Left+1);
if Image1.Left+Image1.Width> panel1.Width then
begin
timer1.Enabled:=false;
Image1.Visible:=false;
end;
end;

2.
procedure TForm1.Timer4Timer(Sender: TObject);
begin
if Image1.Left+Image1.Width> panel1.Width then
begin
Image4.Visible:=true;
Image4.Left:=(Image4.Left+1);
end;
if Image4.Left+Image4.Width>panel4.Width then
begin
timer4.Enabled:=false;
Image4.Visible:=false;
Image2.Visible:=false;
end;
end;

程序我已经写好了,而且能运行,但我想改一下,就是想2运行了后又能跳到1去,1运行了又能跳回2,说简单点就是让他们循环,有没有什么语句实现这个功能啊??

高手帮帮忙,明早就要交了(上面的程序段都是完整的)
能从程序段2跳转到程序段1也行,帮帮忙了啊