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. MouseHover logic

MouseHover logic

Scheduled Pinned Locked Moved C#
question
9 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.
  • A Offline
    A Offline
    Arun Bhalla
    wrote on last edited by
    #1

    Hi, I need to implement my own MouseHover event for a library I'm working on. What is the exact logic of the MouseHover event? I can't find this on MSDN... It seems like the MouseHover is fired only after the first N milliseconds that the mouse is idle in a control, and perhaps only if the control has focus. I expect I'd set a Timer when the MouseMove event is fired, and then invalidate the Timer if the MouseMove event was fired before N milliseconds had elapsed.

    J 1 Reply Last reply
    0
    • A Arun Bhalla

      Hi, I need to implement my own MouseHover event for a library I'm working on. What is the exact logic of the MouseHover event? I can't find this on MSDN... It seems like the MouseHover is fired only after the first N milliseconds that the mouse is idle in a control, and perhaps only if the control has focus. I expect I'd set a Timer when the MouseMove event is fired, and then invalidate the Timer if the MouseMove event was fired before N milliseconds had elapsed.

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      Arun Bhalla wrote: I need to implement my own MouseHover event Why? It's built into WinForms. If you really need to roll your own, try TrackMouseEvent[^]. :)

      "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
      "You must be the change you wish to see in the world." - Mahatma Gandhi

      A 1 Reply Last reply
      0
      • J J Dunlap

        Arun Bhalla wrote: I need to implement my own MouseHover event Why? It's built into WinForms. If you really need to roll your own, try TrackMouseEvent[^]. :)

        "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
        "You must be the change you wish to see in the world." - Mahatma Gandhi

        A Offline
        A Offline
        Arun Bhalla
        wrote on last edited by
        #3

        I'm writing a library of lightweight control-like objects which paint themselves on controls, such as Panel. I need to mimic MouseHover for these control-like objects. If I use Panel's MouseHover event, I only get the hover event once, while the cursor is in Panel's bounds, even if it hovers over my different control-like objects, all within Panel. TrackMouseEvent seems like it may be the way to go, or at least I'll know where to dig for the default value. (Yet another setting missing from SystemInformation.) Thanks!

        J 1 Reply Last reply
        0
        • A Arun Bhalla

          I'm writing a library of lightweight control-like objects which paint themselves on controls, such as Panel. I need to mimic MouseHover for these control-like objects. If I use Panel's MouseHover event, I only get the hover event once, while the cursor is in Panel's bounds, even if it hovers over my different control-like objects, all within Panel. TrackMouseEvent seems like it may be the way to go, or at least I'll know where to dig for the default value. (Yet another setting missing from SystemInformation.) Thanks!

          J Offline
          J Offline
          J Dunlap
          wrote on last edited by
          #4

          Arun Bhalla wrote: I'm writing a library of lightweight control-like objects which paint themselves on controls, such as Panel. Hehe, my team is creating a library of lightweight controls, called Fluid UI Toolkit[^]

          "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
          "You must be the change you wish to see in the world." - Mahatma Gandhi

          A 1 Reply Last reply
          0
          • J J Dunlap

            Arun Bhalla wrote: I'm writing a library of lightweight control-like objects which paint themselves on controls, such as Panel. Hehe, my team is creating a library of lightweight controls, called Fluid UI Toolkit[^]

            "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
            "You must be the change you wish to see in the world." - Mahatma Gandhi

            A Offline
            A Offline
            Arun Bhalla
            wrote on last edited by
            #5

            Cool! I look forward to seeing that near completion... as we all know, the Microsoft-provided WinForms library is not so hot. I guess my library is quite different from yours... mine is more like Visio shape objects rather than things like toolbars.

            J 1 Reply Last reply
            0
            • A Arun Bhalla

              Cool! I look forward to seeing that near completion... as we all know, the Microsoft-provided WinForms library is not so hot. I guess my library is quite different from yours... mine is more like Visio shape objects rather than things like toolbars.

              J Offline
              J Offline
              J Dunlap
              wrote on last edited by
              #6

              Arun Bhalla wrote: I guess my library is quite different from yours... mine is more like Visio shape objects rather than things like toolbars. I figured that. Actually, I plan to use mine for document drawing objects, as it will probably lend itself well to that.

              "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
              "You must be the change you wish to see in the world." - Mahatma Gandhi

              A 1 Reply Last reply
              0
              • J J Dunlap

                Arun Bhalla wrote: I guess my library is quite different from yours... mine is more like Visio shape objects rather than things like toolbars. I figured that. Actually, I plan to use mine for document drawing objects, as it will probably lend itself well to that.

                "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
                "You must be the change you wish to see in the world." - Mahatma Gandhi

                A Offline
                A Offline
                Arun Bhalla
                wrote on last edited by
                #7

                The main reason (or rather, the straw that broke the camel's back) I wrote the library is that Control.Location, etc. didn't inherently support the location on a ScrollableControl relative to AutoScrollPos. Very annoying. There were other issues, though.

                J 1 Reply Last reply
                0
                • A Arun Bhalla

                  The main reason (or rather, the straw that broke the camel's back) I wrote the library is that Control.Location, etc. didn't inherently support the location on a ScrollableControl relative to AutoScrollPos. Very annoying. There were other issues, though.

                  J Offline
                  J Offline
                  J Dunlap
                  wrote on last edited by
                  #8

                  .NET AutoScroll== X| . ;)

                  "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
                  "You must be the change you wish to see in the world." - Mahatma Gandhi

                  A 1 Reply Last reply
                  0
                  • J J Dunlap

                    .NET AutoScroll== X| . ;)

                    "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
                    "You must be the change you wish to see in the world." - Mahatma Gandhi

                    A Offline
                    A Offline
                    Arun Bhalla
                    wrote on last edited by
                    #9

                    Yeah, and I'm lazy. AutoScroll seems to mostly work, but in a tricky and incomplete way. Oh well!

                    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