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 / C++ / MFC
  4. Mouseover

Mouseover

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
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.
  • P Offline
    P Offline
    prathuraj
    wrote on last edited by
    #1

    how to change a button image when mouse is over and leave on button.

    M N 2 Replies Last reply
    0
    • P prathuraj

      how to change a button image when mouse is over and leave on button.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      You could use TrackMouseEvent() using the button's HWND to request to receive WM_MOUSEHOVER and WM_MOUSELEAVE messages. In response to those messages, change the button's bitmap appropriately. Mark

      "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

      1 Reply Last reply
      0
      • P prathuraj

        how to change a button image when mouse is over and leave on button.

        N Offline
        N Offline
        Nelek
        wrote on last edited by
        #3

        Hi, the previous answer is the best way, but if you are in VC++ and not so advanced in knowledge you can make something similar (but not optimal). Check where the button is to know its coordinates in the actual map mode (if you don't know exactly where the button is at coding-time). Use the "void OnMouseMove(UINT nFlags, CPoint point)" and check if the cursor is On the button or Not. I use it to change cursor when the user is on a moveable point in one graphical report.

        -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

        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