I have a sub form which I want to place in a precise place on the desktop using the mouse coordinates but the form ends up in the wrong place, basically i want to place the subform near the mouse when i double click on a list item.
here is the subform code, the problem is it ends up loading in the wrong place, i think it may be that access stores the mouse position differently
/edit: hmm i think i know what i might be, the coords need to be converted to twips/pix instead of pixels ?Code:Private Declare Function GetCursorPos Lib "user32" (lpPoint As _ POINTAPI) As Long Private Type POINTAPI x As Long y As Long End Type Dim a As POINTAPI Dim b As Long Dim c As Long Private Sub Form_Close() Form_frmMain.List0.Requery End Sub Private Sub Form_Load() ret = GetCursorPos(a) With Me .Move a.x, a.y End With End Sub
Last edited by tinmanjo; 18th March 2010 at 05:15 PM.
Is the form modal? Because the units are relative to the Access window rather than absolute values for modal forms...
Try the method at this site to convert pixels to twips:
Last edited by LosOjos; 18th March 2010 at 05:28 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)