I have code that finds the current position of the mouse on the screen in X,Y coordinates.
I am curious if there is something similar that can let me know the X coordinate (basically the .left function but for the screen) of a listbox?
I have code that finds the current position of the mouse on the screen in X,Y coordinates.
I am curious if there is something similar that can let me know the X coordinate (basically the .left function but for the screen) of a listbox?
The LEFT property of the list box. (plus FORM.LEFT)
AFAIK, the LEFT property is the amount of offset from the left edge of form or report, not a screen coordinate.
I don't know anyway to do what you want.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Here is the code for finding the cursor position, not sure if anybody can do some sort of manipulation to find a stationary object.
Code:Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long ' Access the GetCursorPos function in user32.dll Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long ' GetCursorPos requires a variable declared as a custom data type ' that will hold two integers, one for x value and one for y value Type POINTAPI xpos As Long ypose As Long End Type Public Function getmousepointx() As Integer Dim Hold As POINTAPI GetCursorPos Hold getmousepointx = Hold.xpos End Function Public Function getmousepointy() As Integer Dim Hold As POINTAPI GetCursorPos Hold getmousepoint = Hold.ypos End Function