VB Net – Randomly Move Mouse

 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim generator As New Random
Dim randomValue As Integer
Dim randomValue2 As Integer
randomValue = generator.Next(0, My.Computer.Screen.Bounds.Size.Height)
randomValue2 = generator.Next(0, My.Computer.Screen.Bounds.Size.Width)
Dim mousepos As Point
mousepos.X = randomValue
mousepos.Y = randomValue2
Windows.Forms.Cursor.Position = mousepos
End Sub

Every time the timer ticks, it will move the mouse randomly around the screen.


1 comment so far

  1. The Man Who Can't Be Moved on

    im not moveeeeeeeeeeng, im not moveeeeeeeeeeng jea

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: