ListView Scoll?
-
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 (dummylistviewitem
s) and then load the real items (derived fromlistviewitem
) as the user scrolls them into view. Now the tricky bit: no "scroll" event on thelistview
. A little research here at codeproject suggests the thing to do is derive fromlistview
and overide theWndProc
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... -
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 (dummylistviewitem
s) and then load the real items (derived fromlistviewitem
) as the user scrolls them into view. Now the tricky bit: no "scroll" event on thelistview
. A little research here at codeproject suggests the thing to do is derive fromlistview
and overide theWndProc
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...For getting
scrollBar
position, P/invokeGetScrollPos
[System.Runtime.InteropServices.DllImport("user32")]
public static extern int GetScrollPos(int hwnd, int nBar);Regards, Jay.