How do I set the mouse cursor position

Platform: WinForms| Category: Mouse Handling

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;

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.