Beginner. Getting mouse pointer position

  • Thread starter Thread starter Gerhard
  • Start date Start date
G

Gerhard

Hi.
I need to get in some way the X,Y coordinates of the mouse
pointer when I click over a drawing.
I have made a small database to introduce defects during a
quality control and I need to point as exactly as possible
the position of the faults over the drawing of the objetcs
so later, I can make point graphics over the drawing to
show where are the defects..


Thanks
 
Gerhard said:
Hi.
I need to get in some way the X,Y coordinates of the mouse
pointer when I click over a drawing.
I have made a small database to introduce defects during a
quality control and I need to point as exactly as possible
the position of the faults over the drawing of the objetcs
so later, I can make point graphics over the drawing to
show where are the defects..


Thanks

An event procedure for the MouseDown event will receive the X and Y
coordinates.
 
Thanks
And where (in wich variable) can I find the coordinates?

If you set the event property On Mouse Down (on the event tab of a
control or form section's property sheet) to "[Event Procedure]", and
then click the build button (captioned "...") at the end of the property
line, Access will create and display the shell of an event procedure for
that event, which will look like this:

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

End Sub

Whenever the event procedure is called, the X and Y arguments will
contain the x and y coordinates of the cursor at the time the button was
pressed. See the online help for the MouseDown event and its event
procedure for more information.
 
Back
Top