Is it posible to retrieve the position of the mouse pointer, once you click on some image from a userform?
Printable View
Is it posible to retrieve the position of the mouse pointer, once you click on some image from a userform?
Meaning the X/Y coordinates of the mouse on the image?
Exactly
If you are using the default image control then its as easy as this when taken in as relative to the 0, 0 location of the image but if you need screen coordinates then you will need to add extra calculations.
Code:Option Explicit
Private Sub Image1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
MsgBox "X: " & X & vbNewLine & "Y: " & Y, vbInformation + vbOKOnly, "Mouse Location In Image"
End Sub