How can I get a picturebox to move towards the mouse?
I've tried the following code but it doesn't work properly.
It doesn't go straight to the mouse(direction between points?) it either goes up/down or left/right until it reaches the mouse:
I have 2 variables; 'mouseLeft' and 'mouseTop' that get the mouse position in the 'Main_MouseMove' event.
Thanks in advance, knxrbCode:If mouseLeft > picMove.Left Then picMove.Left += 3 End If If mouseLeft < picMove.Left Then picMove.Left -= 3 End If If mouseTop > picMove.Top Then picMove.Top += 3 End If If mouseTop < picMove.Top Then picMove.Top -= 3 End If![]()





Reply With Quote