Serialcoder en Français Serialcoder in English
TEL : +33 (0)9 72 13 15 17

Windows Forms FAQ resources

11. Windows Forms Mouse Handling

11.4 How do I set the mouse cursor position?


The Cursor.Position property is a static property with both get and set methods available. Remember that the Point object used by the property is in screen coordinates. Here is code that move the mouse position down 20 points.

     Point pt = Cursor.Position;
     pt.Y += 20;
     Cursor.Position = pt;