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. Scroll amount

Scroll amount

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

    Hi, I really really desperately need to learn how to get the amount the listview control has scrolled of. Like 10 pixels up or 40 pixels down... I cannot find it anywhere... Thanks

    A 1 Reply Last reply
    0
    • C CaesarCZ

      Hi, I really really desperately need to learn how to get the amount the listview control has scrolled of. Like 10 pixels up or 40 pixels down... I cannot find it anywhere... Thanks

      A Offline
      A Offline
      alex barylski
      wrote on last edited by
      #2

      Just a guess :) UINT nScrollPos = GetScrollPos(SB_VERT) "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr

      C 1 Reply Last reply
      0
      • A alex barylski

        Just a guess :) UINT nScrollPos = GetScrollPos(SB_VERT) "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr

        C Offline
        C Offline
        CaesarCZ
        wrote on last edited by
        #3

        yeah, but that gives me the position instead of the amount of pixel scrolled. Even if I keep the last position and calculate it then, then how will I get the result if it it the first time I request the position and have no previous one... Okay, ,aybe I can assume it was 0... and can I assume it is position = scroll amount in pixels? Thanks

        A 1 Reply Last reply
        0
        • C CaesarCZ

          yeah, but that gives me the position instead of the amount of pixel scrolled. Even if I keep the last position and calculate it then, then how will I get the result if it it the first time I request the position and have no previous one... Okay, ,aybe I can assume it was 0... and can I assume it is position = scroll amount in pixels? Thanks

          A Offline
          A Offline
          alex barylski
          wrote on last edited by
          #4

          If GetScrollBar() is retuning the index of the top most item in the list...multiply this number by the height of each individual item. This value I think can be retreived via CListCtrl::GetItemRect() That calculation will return scroll position in pixels...i think... HTH cheers "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr

          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