VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A funny way to make your control escape from the mouse pointer

by Jorge Loubet Jr. (1 Submission)
Category: Games
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sat 16th October 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A funny way to make your control escape from the mouse pointer

Rate A funny way to make your control escape from the mouse pointer



'Your users are going to hate that.
'In this example you have to put a Command Button on your form and copy this code
'you have to put controls that have top and left properties.

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

'here you have to especify the speed of the control.
s = 10

'Here you especify the name of the control you want to go away
With Command1
    
    If Y < .Top Then
        .Top = .Top + s

    End If
    If Y > .Top Then
        .Top = .Top - s
    End If

    If X < .Left Then
        .Left = .Left + s
    End If

    If X > .Left Then
        .Left = .Left - s
    End If
End With
End Sub



Download this snippet    Add to My Saved Code

A funny way to make your control escape from the mouse pointer Comments

No comments have been posted about A funny way to make your control escape from the mouse pointer. Why not be the first to post a comment about A funny way to make your control escape from the mouse pointer.

Post your comment

Subject:
Message:
0/1000 characters