How to record a mouse position?
Howdy.
I have a button that is labled, Set Mouse.
I need that to pop up a new form(I know how to do that) That says Click where blah blah, then when they click it says, Now click blah blah, Then after they click the second time, and it records those 2 mouse positions to 2 diffrent things. Thanks!
Re: How to record a mouse position?
You can Use Me.MousePosition to get the mouse postion
Re: How to record a mouse position?
Im sorry, I would like to know how to save their mouse position, so that when the timer is up it clicks where they last clicked =)
I guess both
Re: How to record a mouse position?
Piece of cake. I'm not even gonna load up VS for this. Create a List(Of Point), since the Point object has an X and Y, and every time the mouse is clicked, trap the point and add it to the list.
I lied, I am going to load up VS... bloody event args...
vb Code:
Dim myclicks As New List(Of Point)
Private Sub Form1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick
myclicks.Add(New Point(e.X, e.Y))
End Sub
Whenever you need them, every click will have been logged in the myClicks list, which you can loop through very simply:
vb Code:
For Each p As Point In myclicks
'do stuff here
Next
Hope this helps!
Re: How to record a mouse position?
Um.. from his request, he doesn't need to put the mouse anywhere, just record where it's been clicked...
Re: How to record a mouse position?
My apologies, I missed that post. Regardless, I'm sure .NET has a better way of doing it.