Function randint(inmin As Integer, inmax As Integer)
randint = Int(inmin - inmax + 1) * Rnd + inmin
End Function
Sub jump(ctl As Control)
Dim tom1 As Integer, tom2 As Integer
tom1 = randint(0, Width - ctl.Width)
tom2 = randint(0, Height - ctl.Height)
ctl.Move tom1, tom2
End Sub
Private Sub Command1_Click()
jump Command1
End Sub
Private Sub Command2_Click()
jump Command2
End Sub
Private Sub Form_Load()
End Sub