for i:=0 to 200 do
begin image2.Left:=image2.Left+1;
 image2.Top:=image2.Top+1;
 sleep(10);
 application.ProcessMessages;
end

解决方案 »

  1.   

    procedure Tssxsfrm.Button2Click(Sender: TObject);
    begin
     moveflag:=not moveflag;
    end;for i:=0 to 200 do
    begin
     if moveflag then begin
     image2.Left:=image2.Left+1;
     image2.Top:=image2.Top+1;
     sleep(10);
     application.ProcessMessages;
     end;
    end
      

  2.   

    其实最好不要用image,用form1.canvas.draw()就可以了,这样每一次画出后,隔一段时间擦除,再重新画,很快,不会闪动,如果有兴趣就试试吧