Wednesday, June 30, 2010

Change Cursor Position

With the class Cursor you can set the mouse position in C#. The corresponding property has the name Position, it saves the position of the cursor as a Point.
The position is global (so not only relative to the application), so for example (0, 0) describes the very upper left corner of the screen.
Setting the cursor position then can be done by:
Cursor.Position = new Point(X, Y);

No comments:

Post a Comment