Kod:
procedure TForm1.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,

Y: Integer);

begin

randomize;

button1.Top :=random(form1.Height);

button1.Left:=random(form1.Width);

end;