If i click on a picturebox how can i get it so the mouse moves to the top left of the picture box?
Printable View
If i click on a picturebox how can i get it so the mouse moves to the top left of the picture box?
Would this work for you?
VB Code:
Option Explicit Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Declare Function SetCursorPos Lib "user32" _ (ByVal X As Long, ByVal Y As Long) As Long Private Declare Function GetWindowRect Lib "user32" _ (ByVal hwnd As Long, lpRect As RECT) As Long Private Sub Picture1_Click() Dim rec As RECT GetWindowRect Picture1.hwnd, rec SetCursorPos rec.Left, rec.Top End Sub
Thanks