Programmatically move the mouse cursor

Posted on 2006-04-04
Last Modified: 2011-08-18
Without using the Win32 do I programmatically move the mouse from one position to another, under VS .NET 2005?
Question by:knowlton
    LVL 10

    Expert Comment

    If this an windows app then this will do the trick.

    x = 10;
    y = 20;
    Cursor.Position = new Point(x,y);
    LVL 19

    Accepted Solution

    LVL 96

    Assisted Solution

    by:Bob Learned
    Cursor.Position will work, but you need to convert to screen coordinates:

         Cursor.Position = this.PointToScreen(Me.textBox1.Location);


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now