Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. How to set mouse position?

How to set mouse position?

Scheduled Pinned Locked Moved WPF
dockerhelptutorialquestion
9 Posts 4 Posters 22 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yoyosch
    wrote on last edited by
    #1

    How to set mouse position? Something opposite to Mouse.GetPosition(container) Thanks for help

    P 1 Reply Last reply
    0
    • Y Yoyosch

      How to set mouse position? Something opposite to Mouse.GetPosition(container) Thanks for help

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Off the top of my head (and without firing up Visual Studio to check) I believe you would use Cursor.Position = new Point(x, y);.

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      Y 1 Reply Last reply
      0
      • P Pete OHanlon

        Off the top of my head (and without firing up Visual Studio to check) I believe you would use Cursor.Position = new Point(x, y);.

        Deja View - the feeling that you've seen this post before.

        My blog | My articles

        Y Offline
        Y Offline
        Yoyosch
        wrote on last edited by
        #3

        So fire up VS and see that ur answer is silly

        P L 2 Replies Last reply
        0
        • Y Yoyosch

          So fire up VS and see that ur answer is silly

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Yoyosch wrote:

          So fire up VS and see that ur answer is silly

          Nope. I just ran it and it worked fine for me. Have you tried it?

          Deja View - the feeling that you've seen this post before.

          My blog | My articles

          Y 1 Reply Last reply
          0
          • P Pete OHanlon

            Yoyosch wrote:

            So fire up VS and see that ur answer is silly

            Nope. I just ran it and it worked fine for me. Have you tried it?

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            Y Offline
            Y Offline
            Yoyosch
            wrote on last edited by
            #5

            Of course. This works in WinForms but not in WPF

            P 1 Reply Last reply
            0
            • Y Yoyosch

              So fire up VS and see that ur answer is silly

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Yoyosch, Pete is trying to help you. Telling a Code Project MVP that his answer is silly does not promote good lines of communication. Thanks for working with us as we try and answer questions here. Have a nice day.

              Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

              Just a grain of sand on the worlds beaches.

              C 1 Reply Last reply
              0
              • L Lost User

                Yoyosch, Pete is trying to help you. Telling a Code Project MVP that his answer is silly does not promote good lines of communication. Thanks for working with us as we try and answer questions here. Have a nice day.

                Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

                Just a grain of sand on the worlds beaches.

                C Offline
                C Offline
                Colin Angus Mackay
                wrote on last edited by
                #7

                Sorry I missed you at the MVP summit last week. I did, however, manage to speak to a few people that know you and you received some very high praise indeed.

                Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) My website | Blog

                L 1 Reply Last reply
                0
                • C Colin Angus Mackay

                  Sorry I missed you at the MVP summit last week. I did, however, manage to speak to a few people that know you and you received some very high praise indeed.

                  Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) My website | Blog

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Colin, Me too. Don't know how we missed hooking up. Guess I'll just have to come and visit or get you to come to Charlotte! Was very nice to meet so many cool and very smart developers. Super week for everyone. Best to you always!

                  Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

                  Just a grain of sand on the worlds beaches.

                  1 Reply Last reply
                  0
                  • Y Yoyosch

                    Of course. This works in WinForms but not in WPF

                    P Offline
                    P Offline
                    Pete OHanlon
                    wrote on last edited by
                    #9

                    There's nothing stopping you adding the WinForms reference to WPF and doing this.

                    Deja View - the feeling that you've seen this post before.

                    My blog | My articles

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups