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. ListView Scoll?

ListView Scoll?

Scheduled Pinned Locked Moved C#
question
2 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.
  • B Offline
    B Offline
    Bill Dean
    wrote on last edited by
    #1

    Hi all, I have a windows form listview (in details mode) that I want to essentially fill on demand. Each item is moderately expensive to load and there may be 1000's of them in some cases. So my plan: fill it with place-holders (dummy listviewitems) and then load the real items (derived from listviewitem) as the user scrolls them into view. Now the tricky bit: no "scroll" event on the listview. A little research here at codeproject suggests the thing to do is derive from listview and overide the WndProc method and handle the WM_VSCROLL message. All good so far. My question: how can I tell how far it has scrolled? More directly: how can I tell which items will be visible to the user? Thanks in advance, Bill ps: Is there an easier way to do this that I am missing? I can't be the only person who's tried this...

    J 1 Reply Last reply
    0
    • B Bill Dean

      Hi all, I have a windows form listview (in details mode) that I want to essentially fill on demand. Each item is moderately expensive to load and there may be 1000's of them in some cases. So my plan: fill it with place-holders (dummy listviewitems) and then load the real items (derived from listviewitem) as the user scrolls them into view. Now the tricky bit: no "scroll" event on the listview. A little research here at codeproject suggests the thing to do is derive from listview and overide the WndProc method and handle the WM_VSCROLL message. All good so far. My question: how can I tell how far it has scrolled? More directly: how can I tell which items will be visible to the user? Thanks in advance, Bill ps: Is there an easier way to do this that I am missing? I can't be the only person who's tried this...

      J Offline
      J Offline
      Jay Shankar
      wrote on last edited by
      #2

      For getting scrollBar position, P/invoke GetScrollPos

      [System.Runtime.InteropServices.DllImport("user32")]
      public static extern int GetScrollPos(int hwnd, int nBar);

      Regards, Jay.

      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