Getting MouseMove to pass XY Coordinates 
Author Message
 Getting MouseMove to pass XY Coordinates

-------------------------------
QUESTION #1 How would I get the MouseMove Sub to pass it's X, Y Coordinates
to the Click Sub, upon the click event?

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single,
Y As Single)
<code>
End Sub

Private Sub Form_Click()
<code to receive the x and the y coordinate upon click>
End Sub

-----------------------------
QUESTION#2 Also, while still answering question1, Is there a standard code
that I could put in the click event to "tell me" the x, y coordinate, when
which when I click on the Form without using the mousemove sub to get the
coordinate?

Private Sub Form_Click()
<code to receive the x and the y coordinate upon click>
End Sub

Thank you in advance for sharing your knowledge with me



Sat, 06 Oct 2001 03:00:00 GMT  
 Getting MouseMove to pass XY Coordinates
-------------------------------
QUESTION #1 How would I get the MouseMove Sub to pass it's X, Y Coordinates
to the Click Sub, upon the click event? (I am wrting code that will respond
only if clicked on a certain part of the form. )

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single,
Y As Single)
<code>
End Sub

Private Sub Form_Click()
<code to receive the x and the y coordinate upon click>
End Sub

-----------------------------
QUESTION#2 Also, while still answering question1, Is there a standard code
that I could put in the click event to "tell me" the x, y coordinate, when
which when I click on the Form without using the mousemove sub to get the
coordinate?

Private Sub Form_Click()
<code to receive the x and the y coordinate upon click>
End Sub

Thank you in advance for sharing your knowledge with me.



Sat, 06 Oct 2001 03:00:00 GMT  
 Getting MouseMove to pass XY Coordinates

Quote:
> -------------------------------
> QUESTION #1 How would I get the MouseMove Sub to pass it's X, Y
Coordinates
> to the Click Sub, upon the click event? (I am wrting code that will
respond
> only if clicked on a certain part of the form. )

> Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As
Single,
> Y As Single)
> <code>
> End Sub

> Private Sub Form_Click()
> <code to receive the x and the y coordinate upon click>
> End Sub

Declare Form level variables (in the General Declarations section of the
form).
Dim mX as Single
Dim mY as Single

Set them in the MouseMove event.
Read them in the Click event.

Quote:
> -----------------------------
> QUESTION#2 Also, while still answering question1, Is there a standard code
> that I could put in the click event to "tell me" the x, y coordinate, when
> which when I click on the Form without using the mousemove sub to get the
> coordinate?

> Private Sub Form_Click()
> <code to receive the x and the y coordinate upon click>
> End Sub

Win 32 API:
GetCursorPos

N. Varacalli



Tue, 09 Oct 2001 03:00:00 GMT  
 Getting MouseMove to pass XY Coordinates

Quote:



>> -------------------------------
>> QUESTION #1 How would I get the MouseMove Sub to pass it's X, Y
>Coordinates
>> to the Click Sub, upon the click event? (I am wrting code that will
>respond
>> only if clicked on a certain part of the form. )

>> Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As
>Single,
>> Y As Single)
>> <code>
>> End Sub

>> Private Sub Form_Click()
>> <code to receive the x and the y coordinate upon click>
>> End Sub

>Declare Form level variables (in the General Declarations section of the
>form).
>Set them in the MouseMove event.
>Read them in the Click event.

Agreed.

Quote:
>> -----------------------------
>> QUESTION#2 Also, while still answering question1, Is there a standard code
>> that I could put in the click event to "tell me" the x, y coordinate, when
>> which when I click on the Form without using the mousemove sub to get the
>> coordinate?

>> Private Sub Form_Click()
>> <code to receive the x and the y coordinate upon click>
>> End Sub

>Win 32 API:
>GetCursorPos

Well, you could use an API call, but it's a lot simpler to use the
MouseUp or MouseDown event as a replacement for the Form click event;
both give you the pointer position.

Zak  



Tue, 09 Oct 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Getting MouseMove to pass X,Y Coordinates

2. Trying to obtain the screen xy coordinates of a range of selected cells

3. XY coordinates of picturebox

4. TreeView Nodes XY Coordinates?

5. Angles from XY Coordinates

6. How do I coordinate the screen's coordinates with a form coordinate

7. MSChart - Getting XY coordinates from axis scale on mousedown ?????

8. Getting/Setting a Forms Window Coordinates

9. Getting coordinates to set mousepointer

10. Getting Mouse Coordinates

11. Getting menu coordinates

12. Getting coordinates of a Node in a TreeView

 

 
Powered by phpBB® Forum Software