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. C#
  4. mouse position relative to the whole screen?

mouse position relative to the whole screen?

Scheduled Pinned Locked Moved C#
questionhelp
2 Posts 2 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.
  • D Offline
    D Offline
    dazinith
    wrote on last edited by
    #1

    i am using a mouse move message handler which is passing in System.Windows.Forms.MouseEventArgs e.. the problem is that e.X and e.Y are both relative to the current control which is calling the message handler.. how can i get the mouse position relative to the entire screen, not the control thats calling it? something like clienttorect or something? thanks! still a newb.. cut me some slack :P -dz

    H 1 Reply Last reply
    0
    • D dazinith

      i am using a mouse move message handler which is passing in System.Windows.Forms.MouseEventArgs e.. the problem is that e.X and e.Y are both relative to the current control which is calling the message handler.. how can i get the mouse position relative to the entire screen, not the control thats calling it? something like clienttorect or something? thanks! still a newb.. cut me some slack :P -dz

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      See Control.PointToClient and Control.PointToScreen (there's also variants of those for Rectanges).


      Reminiscent of my younger years... 10 LOAD "SCISSORS" 20 RUN

      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