unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Image1: TImage;
    Image2: TImage;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure pause(zeit:integer);
var anfang:integer;
begin
anfang:=gettickcount;
while anfang+zeit>gettickcount do
application.processmessages;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
form1.doublebuffered:=true;
while image2.left + image2.width< image1.Width do
begin
image2.left:=image2.left+4;
pause(2);
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
image2.left:=image1.left;
end;

end.
