unit fbuttr;

interface

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

type
  TForm1 = class(TForm)
    OpenWings: TImage;
    CloseWings: TImage;
    Main: TImage;
    Timer1: TTimer;
    cmdExit: TButton;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure cmdExitClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Timer1Timer(Sender: TObject);
const
     PickBmp:Boolean = False;
begin
     Main.SetBounds ((Main.Left + 20) Mod ClientWidth,
                     (Main.Top - 5 + ClientHeight) Mod
                      ClientHeight,Main.Width, Main.Height);
     if PickBmp = True then
         Main.Picture := OpenWings.Picture
     else
         Main.Picture := CloseWings.Picture;
     PickBmp := Not PickBmp;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
     cmdExit.SetBounds (10, 10, cmdExit.Width, cmdExit.Height);
end;

procedure TForm1.cmdExitClick(Sender: TObject);
begin
     Close;
end;

end.
