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. Visual Basic
  4. Move mouse with code

Move mouse with code

Scheduled Pinned Locked Moved Visual Basic
helpquestion
4 Posts 3 Posters 0 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.
  • E Offline
    E Offline
    ecentinela
    wrote on last edited by
    #1

    I'm trying to move the mouse over a button with code but I can't. I found this property "Control.MousePosition" but I can't do it. Someone can help me? Thanks

    M 1 Reply Last reply
    0
    • E ecentinela

      I'm trying to move the mouse over a button with code but I can't. I found this property "Control.MousePosition" but I can't do it. Someone can help me? Thanks

      M Offline
      M Offline
      MohammadAmiry
      wrote on last edited by
      #2

      use the following API: Public Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long

      E 1 Reply Last reply
      0
      • M MohammadAmiry

        use the following API: Public Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long

        E Offline
        E Offline
        ecentinela
        wrote on last edited by
        #3

        Thanks a lot, it works well!!

        R 1 Reply Last reply
        0
        • E ecentinela

          Thanks a lot, it works well!!

          R Offline
          R Offline
          rudy net
          wrote on last edited by
          #4

          Also try setting the Cursor.Position property.

          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