need code for c# to give mouse position when left mouse button...
need code for c# to give mouse position when left mouse button is clicked ...
Can some one help me in c# .. in my app, I want to have app return to me the SCREEN (nor Form) coordinates of mouse pointer when the left mouse button is clicked ....
I know this can be done, but I can't quite write the code to do it properly .... if anyone could help me, that would just be great.
Thank you.
Re: need code for c# to give mouse position when left mouse button...
Re: need code for c# to give mouse position when left mouse button...
But how do I 'watch for & detect' the 'left mouse click' ?
Re: need code for c# to give mouse position when left mouse button...
You want to detect a mouse click at any time? That would require a hook into the OS. If you want to be notified when your form is clicked simply handle OnMouseClick or OnMouseDown.
Here is an article on how to set a hook using C#:
http://support.microsoft.com/kb/318804
Re: need code for c# to give mouse position when left mouse button...
I will check it out ... thanks so much :)