Dre__ Posted March 13, 2010 Posted March 13, 2010 How can I move the mouse using code. Say I click Command1, the mouse would move a certain number of units. Where can I find a tutorial on how to do this? Quote
Leaders snarfblam Posted March 13, 2010 Leaders Posted March 13, 2010 Found this solution on Google. You can set the cursor's position using the Cursor class' Position property. For example, this function would move the mouse: [color="Blue"]void[/color] MoveMouse([color="Blue"]int [/color]x, [color="Blue"]int [/color]y) { Cursor.Position = [color="Blue"]new [/color]Point(Cursor.Position.X + x, Cursor.Position.Y + y); } Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.