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. Finding MousePointer in WinForms

Finding MousePointer in WinForms

Scheduled Pinned Locked Moved C#
csharpwinformsquestion
3 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.
  • V Offline
    V Offline
    VenkataRamana Gali
    wrote on last edited by
    #1

    Hello Coders, In my Form I have LinkButton, PictureBox. I want to populate the ContextMenu MenuItems Dynamically based on the Control . for this i need to find at which control mouse pointer is ? any sounds will be appriciated. regards GV Ramana

    K 1 Reply Last reply
    0
    • V VenkataRamana Gali

      Hello Coders, In my Form I have LinkButton, PictureBox. I want to populate the ContextMenu MenuItems Dynamically based on the Control . for this i need to find at which control mouse pointer is ? any sounds will be appriciated. regards GV Ramana

      K Offline
      K Offline
      Koushik Biswas
      wrote on last edited by
      #2

      Your question, at face value, sounds meaningless. Handle right click on the link button and populate the context menu accordingly (as it should be for the link button), and handle right click for the picturebox, and do the same in its handler. That's it! But obviously the fact that you have asked the question means that there is more to it than that! So what's more? Koushik Biswas

      L 1 Reply Last reply
      0
      • K Koushik Biswas

        Your question, at face value, sounds meaningless. Handle right click on the link button and populate the context menu accordingly (as it should be for the link button), and handle right click for the picturebox, and do the same in its handler. That's it! But obviously the fact that you have asked the question means that there is more to it than that! So what's more? Koushik Biswas

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        I think he is looking for a generic way, something like Form.KeyPreview is for keys but for the mouse. The only way I think is to use hooks, as this is the only approach I have seen.

        xacc.ide-0.1.3-rc0
        Now even better!

        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