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. OnClik and OnDoubleClick event

OnClik and OnDoubleClick event

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 4 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.
  • S Offline
    S Offline
    SandeepN
    wrote on last edited by
    #1

    I am handling OnClik and OnDoubleClick event on a listControl. When ever user doubleclicks on a item, first onclick and then OnDoubleClick event gets fired. Is there a way to avoid onclick event when user has DoubleClicked on the item ? Sandeep Naik

    B R 2 Replies Last reply
    0
    • S SandeepN

      I am handling OnClik and OnDoubleClick event on a listControl. When ever user doubleclicks on a item, first onclick and then OnDoubleClick event gets fired. Is there a way to avoid onclick event when user has DoubleClicked on the item ? Sandeep Naik

      B Offline
      B Offline
      BlackDice
      wrote on last edited by
      #2

      How about starting a timer that's longer than the interval between double-clicks? So if 200 ms is the longest interval between double-clicks, start a timer with an interval of 250ms. In double-click event and in timer event, kill the timer. [insert witty comment here] bdiamond :zzz:

      S 1 Reply Last reply
      0
      • S SandeepN

        I am handling OnClik and OnDoubleClick event on a listControl. When ever user doubleclicks on a item, first onclick and then OnDoubleClick event gets fired. Is there a way to avoid onclick event when user has DoubleClicked on the item ? Sandeep Naik

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        I'm curious: what does your On``Click() handler do (eg: does it update a selection count?) /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        S 1 Reply Last reply
        0
        • R Ravi Bhavnani

          I'm curious: what does your On``Click() handler do (eg: does it update a selection count?) /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

          S Offline
          S Offline
          SandeepN
          wrote on last edited by
          #4

          OnClick refreshes the selected item on the listViewControl. DoubleClick refreshes and then allows the user to modify it. The refreshing happens twice in this case. Sandeep Naik

          D 1 Reply Last reply
          0
          • B BlackDice

            How about starting a timer that's longer than the interval between double-clicks? So if 200 ms is the longest interval between double-clicks, start a timer with an interval of 250ms. In double-click event and in timer event, kill the timer. [insert witty comment here] bdiamond :zzz:

            S Offline
            S Offline
            SandeepN
            wrote on last edited by
            #5

            Thanks a lot.... I could solve the problem Sandeep Naik

            1 Reply Last reply
            0
            • S SandeepN

              OnClick refreshes the selected item on the listViewControl. DoubleClick refreshes and then allows the user to modify it. The refreshing happens twice in this case. Sandeep Naik

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              From look at Spy++, when a list control single-clicked, it receives a WM_LBUTTONDOWN message followed by a WM_LBUTTONUP message. When a list control double-clicked, it receives those two messages followed by a WM_LBUTTONDBLCLK and WM_LBUTTONUP. Can you monitor for WM_LBUTTONDOWN and WM_LBUTTONDBLCLK separately?


              "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

              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