0
Hello guys I’m having a problem, well I already managed to get the mouse position in relation to form !
For this I used a form with the NONE border, maximized, and opacity 5% and when the user clicks on this form it closes !
To get the coordinate of the form I used the event Mousemove and did as below. To send to 2 textbox in another form.
Posição.PosX.Text = e.X & vbLf
Posição.PosY.Text = e.Y & vbLf
It sends in the following style for each Textbox, only the number: 0 / 0.
But I noticed that when I do the function to move the mouse to this coordinate, it moves wrong. Good it happens that it moves so many "x" / "y" from the mouse position. And this was not to happen, it was to move up the pixel of the SCREEN.
If you are confused it is as follows: it moves 200 and 300 of the cursor, does not move to the 200 and 300 pixel of the screen.
To move I used the following:
Cursor.Position = New Point(Cursor.Position.X - PosX.Text, Cursor.Position.Y - PosY.Text)
So to summarize:
The mouse is moved using its location, what I want is that it moves using the pixels of the SCREEN.
I would also like to know if it is possible that it always moves the cursor to the specified location even with the application in the background.
I have seen some programs like this, and created in VB.NET but I do not have access to the source code. CAN BE IN VB NET OR C#.
If you’re a little confused, talk down and I’ll try to explain even better..
Opa I already got what I wanted like the mouse pointer was moved XY of itself was not moved to XY of the screen. But I removed Cursor.Position and it worked ;)
– Lucas Anderson