Get x & y POSITION

  • Thread starter Thread starter RUDWAN
  • Start date Start date
R

RUDWAN

hi
on mouse events on the form , we can get x & y position
but in other events else of using mouse , how we could get
it
like :
private Mytext_afterupdate
me.mytext.selstart=me.mytext.selwidth
end sub

how i could know at that event , x & y ?
 
RUDWAN said:
hi
on mouse events on the form , we can get x & y position
but in other events else of using mouse , how we could get
it
like :
private Mytext_afterupdate
me.mytext.selstart=me.mytext.selwidth
end sub

how i could know at that event , x & y ?

I believe you'd have to record this information in the MouseMove event,
storing it in module-level variables so that it could be read from other
procedures such as the control's AfterUpdate event procedure.
 
rudwan said:
how this would be on module , ?
could u give an example for that please

Air code would be something like this:

'----- start of form module code ("air code") -----
Option Compare Database
Option Explicit

Dim msngXPos As Single
Dim msngYPos As Single

Private Sub Mytext_AfterUpdate()

MsgBox "Mouse was last at (" _
& msngXPos & ", " & msngYPos & _
") in the text box."

End Sub

Private Sub Mytext_MouseMove( _
Button As Integer, _
Shift As Integer, _
X As Single, _
Y As Single)

msngXPos = X
msngYPos = Y

End Sub

'----- end of form module code -----
 
yes , it is ok
that will help me
thanks
-----Original Message-----


Air code would be something like this:

'----- start of form module code ("air code") -----
Option Compare Database
Option Explicit

Dim msngXPos As Single
Dim msngYPos As Single

Private Sub Mytext_AfterUpdate()

MsgBox "Mouse was last at (" _
& msngXPos & ", " & msngYPos & _
") in the text box."

End Sub

Private Sub Mytext_MouseMove( _
Button As Integer, _
Shift As Integer, _
X As Single, _
Y As Single)

msngXPos = X
msngYPos = Y

End Sub

'----- end of form module code -----

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
Back
Top