Jump to content

Recommended Posts

Posted (edited)

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

 

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

 

/edit: hmm i think i know what i might be, the coords need to be converted to twips/pix instead of pixels ?

Edited by tinmanjo

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...