Try this:
Put a timer control and a picturebox on the form and this code:
You can alter the MoveUnits and the Timer1.Interval to get the desired speed and tolerence.
vb.net Code:
Public Class Form1
Const MoveUnits As Integer = 5
Dim mouseX, mouseY As Integer
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Timer1.Interval = 5
Timer1.Enabled = True
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
mouseX = e.X
mouseY = e.Y
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim nX, nY As Integer
nX = PictureBox1.Left + PictureBox1.Width \ 2
nY = PictureBox1.Top + PictureBox1.Height \ 2
If mouseX > nX Then nX += MoveUnits Else nX -= MoveUnits
If mouseY > nY Then nY += MoveUnits Else nY -= MoveUnits
If Math.Abs(mouseX - nX) > MoveUnits Then PictureBox1.Left = nX - PictureBox1.Width \ 2
If Math.Abs(mouseY - nY) > MoveUnits Then PictureBox1.Top = nY - PictureBox1.Height \ 2
End Sub
End Class
Pradeep