Mouse Coordinates

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
4 posts Page 1 of 1
Contributors
User avatar
Snyper345
VIP - Donator
VIP - Donator
Posts: 471
Joined: Mon Nov 01, 2010 1:53 am

Mouse Coordinates
Snyper345
Credits to macHard for helping me a while ago on how to do it|

-Make a new project with a 1 label on it
-add a timer , make sure its enabled with an interval of 3 doesnt really matter
-add this code to the timer and your done :)
Code: Select all
Dim MousePosition As Point
MousePosition = Cursor.Position
Label1.Text = "Mouse Position: " & MousePosition.ToString
Image
Image
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: Mouse Coordinates
Usman55
This is what can also be used as a mouse recorder with very little coding. +rep
Image
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Mouse Coordinates
Axel
You can also use while(true) instead of a timer, in C# your application freezes if you do that but in vb not lol Im not sure why
http://vagex.com/?ref=25000
User avatar
bisnes_niko
Serious Programmer
Serious Programmer
Posts: 409
Joined: Tue Aug 24, 2010 1:21 pm

Re: Mouse Coordinates
bisnes_niko
Axel wrote:
You can also use while(true) instead of a timer, in C# your application freezes if you do that but in vb not lol Im not sure why
That's why because it goes to a never ending loop, the program waits for it to end (which in this case will never happen)

To make it work with that, it would probably only work with multi-threading. To make it not lag, I would add a sleep for in example 1 second(s)
4 posts Page 1 of 1
Return to “Tutorials”