C# Mouse point place?

Posted on 2009-04-24
Last Modified: 2013-12-17
I have 1 textbox with tabIndex =0;

I have 1 button, how can I do to move mouse point to tabIndex =0 when I click the button?

Please help me.
Question by:Mr_Bach
    LVL 26

    Accepted Solution

    do you want to move the cursor to the text box or the mouse pointer to the text box when you click the button
    to do the first its quite simple as you can do txtBox.Focus(); or something like that
    LVL 3

    Expert Comment

    For moving mouse pointer use System.Windows.Forms.Cursor class
    Position property.

    Cursor.Position = new Point (X, Y);

    If you'd like to switch focus - just call textBox.Focus() method
    LVL 15

    Expert Comment

    I agree with Aleksei_Malkov.
    Also, moving the mouse cursor without input (I'm not counting the button click here) is not user friendly. As a user I should control the mouse position, not the application.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    761 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

    7 Experts available now in Live!

    Get 1:1 Help Now