[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Get the Mouse position not using events

Teis Draiby

10/20/2004 3:26:00 AM

Using C#, is there any way to query for the mouse position and button states
without using events (like MouseMove). Something like simply reading a
property somewhere.

Regards, Teis


2 Answers

Teis Draiby

10/20/2004 5:08:00 AM

0

Got it: System.Windows.Forms.Cursor
I feel pretty stupid by now... but, hey, searches on this all result in
loads of examples using MouseMove().


regards, Teis

>
> Using C#, is there any way to query for the mouse position and button
states without using events?


Bob Powell

10/20/2004 10:22:00 AM

0

Control has static properties for MousePosition, MouseButtons and
ModifierKeys.

Remember that the position reported will be in screen units and so to use
them in the context of any given control or form you'll have to call the
specific PointToClient method for that window.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdipl...

The GDI+ FAQ RSS feed: http://www.bobpowell.net/f...
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tips...
Bob's Blog: http://bobpowelldotnet.blogspot.co...






"Teis Draiby" <teisREMOVE-THIS@draiby.com> wrote in message
news:e9V%23FSltEHA.820@TK2MSFTNGP12.phx.gbl...
> Using C#, is there any way to query for the mouse position and button
states
> without using events (like MouseMove). Something like simply reading a
> property somewhere.
>
> Regards, Teis
>
>