I'm trying to make a rectangle follow my mouse along the X axis.
For some reason, the rectangle toggle between two places on my form, both
somewhat proportional from where I first click, but neither in line with the
mouse pointer. It's as if at:
* one pixel X=how far the mouse has moved from the point it clicked, the
* next pixel X=current X position minus how far the mouse has moved.
Here's my code.
Private Sub rctMarker_Mouse Move(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If (Button And acLeftButton) 0 Then
rctMarker.Left = X
End If
End Sub
Am I doing this correctly, or am I supposed to reference to the forms X
reference?
Thanks in advance.
Dom
For some reason, the rectangle toggle between two places on my form, both
somewhat proportional from where I first click, but neither in line with the
mouse pointer. It's as if at:
* one pixel X=how far the mouse has moved from the point it clicked, the
* next pixel X=current X position minus how far the mouse has moved.
Here's my code.
Private Sub rctMarker_Mouse Move(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If (Button And acLeftButton) 0 Then
rctMarker.Left = X
End If
End Sub
Am I doing this correctly, or am I supposed to reference to the forms X
reference?
Thanks in advance.
Dom
Comment