unit Wait;

interface

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

type
  TWaitForm = class(TForm)
    Image1: TImage;
    Shape1: TShape;
    Label1: TLabel;
    Label2: TLabel;
    bvl: TBevel;
    shBlock: TShape;
    Timer: TTimer;
    procedure TimerTimer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    Count, Direction: Integer;
  end;

var
  WaitForm: TWaitForm;

implementation

{$R *.dfm}

procedure TWaitForm.TimerTimer(Sender: TObject);
begin
  Count := Count + 1;
  if (Count<=39) and (Count>=1) then
  begin
  if Direction=0 then
   shBlock.Left := 178 + Count*8
  else
   shBlock.Left := 510 - Count*8;
  if (Count=39) or (Count=0) then
  begin
   Count := 0;
    if Direction=0 then
     Direction := 1
    else
     Direction := 0;
  end;
  end
  else
  begin
    Count := 0;
    if Direction=0 then
     Direction := 1
    else
     Direction := 0;
  end;
end;

procedure TWaitForm.FormCreate(Sender: TObject);
begin
  DoubleBuffered := True;
end;

end.
