Unit Unit1;

interface

uses System, System.Drawing, System.Windows.Forms;

type
  Form1 = class(Form)
    procedure button1_Click(sender: Object; e: EventArgs);
    procedure button2_Click(sender: Object; e: EventArgs);
  {$region FormDesigner}
  internal
    {$resource Unit1.Form1.resources}
    pictureBox1: PictureBox;
    pictureBox2: PictureBox;
    button2: Button;
    button1: Button;
    {$include Unit1.Form1.inc}
  {$endregion FormDesigner}
  public
    constructor;
    begin
      InitializeComponent;
    end;
  end;

implementation

procedure Form1.button1_Click(sender: Object; e: EventArgs);
begin
  DoubleBuffered := true;
  PictureBox1.Top := 220;
  var rnd: Random := new Random();
  PictureBox1.Left := rnd.Next(300);
  PictureBox1.Visible := True;
end;

procedure Form1.button2_Click(sender: Object; e: EventArgs);
begin
  DoubleBuffered := true;
  PictureBox2.Top := 220;
  var rnd: Random := new Random();
  PictureBox2.Left := rnd.Next(300);
  PictureBox2.Visible := True;
end;

end.
