Chase the Button.
Chase the Button.
Rate Chase the Button.
(2(2 Vote))
Private Sub cmdButton_Click()
MsgBox "You Caught me", vbOKOnly, "If you see this You cheated"
End Sub
Private Sub cmdButton_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim vHMid As Variant
Dim vWMid As Variant
vHMid = cmdButton.Height / 2
vWMid = cmdButton.Width / 2
If X < vWMid Then
cmdButton.Left = cmdButton.Left + 20
ElseIf X > vWMid Then
cmdButton.Left = cmdButton.Left - 20
End If
If Y < vHMid Then
cmdButton.Top = cmdButton.Top + 20
ElseIf X > vWMid Then
cmdButton.Top = cmdButton.Top - 20
End If
If cmdButton.Top <= 0 Then cmdButton.Top = Int((1000 * Rnd) + 1)
If cmdButton.Top + cmdButton.Height >= frmmain.Height Then cmdButton.Top = Int((1000 * Rnd) + 1)
If cmdButton.Left <= 0 Then cmdButton.Left = Int((1000 * Rnd) + 1)
If cmdButton.Left + cmdButton.Width >= frmmain.Width Then cmdButton.Left = Int((1000 * Rnd) + 1)
End Sub
Chase the Button. Comments
No comments yet — be the first to post one!
Post a Comment