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. Detecting the Mouse Wheel on a ListView Control

Detecting the Mouse Wheel on a ListView Control

Scheduled Pinned Locked Moved C#
comtutorialquestion
4 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.
  • D Offline
    D Offline
    Darryl Borden
    wrote on last edited by
    #1

    Has anyone figured out how to detect the movement of the mouse wheel when the mouse is over a listview control?

    Darryl Borden Principal IT Analyst dborden@eprod.com

    D S 3 Replies Last reply
    0
    • D Darryl Borden

      Has anyone figured out how to detect the movement of the mouse wheel when the mouse is over a listview control?

      Darryl Borden Principal IT Analyst dborden@eprod.com

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      You can create your own class that derives from ListView, override WndProc and catch WM_MOUSEWHEEL to raise an event and/or handle it directly there. [edit] WM constants[^]

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

      1 Reply Last reply
      0
      • D Darryl Borden

        Has anyone figured out how to detect the movement of the mouse wheel when the mouse is over a listview control?

        Darryl Borden Principal IT Analyst dborden@eprod.com

        S Offline
        S Offline
        Seraph_summer
        wrote on last edited by
        #3

        You can directly and eventhandler Mouse_Wheel (sth like that) to the listview you use.

        1 Reply Last reply
        0
        • D Darryl Borden

          Has anyone figured out how to detect the movement of the mouse wheel when the mouse is over a listview control?

          Darryl Borden Principal IT Analyst dborden@eprod.com

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          Seraph_summer is correct - for some reason MS have hidden it from the designer but it's available in the editor. I'll check the source later and see if I can figure out why!

          listView1.MouseWheel += new MouseEventHandler(listView1_MouseWheel);
          void listView1_MouseWheel(object sender, MouseEventArgs e)
          {
          // Do stuff!
          }

          Dave
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
          Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

          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