Back

Button Fun!

procedure TForm1.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
    Button1.Left := Random(604);
    Button1.Top := Random(445);
    Button1.Caption := IntToStr(Button1.Left);
end;
This is a great joke, start with a blank Form, add a Button and put the above code in Button1 MouseMove. Run the program and ask your friends to click on the Button :-)


Back