Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found an answer using some code from the great ObjectListView code-project: <a href="http://www.codeproject.com/KB/list/ObjectListView.aspx" rel="nofollow">http://www.codeproject.com/KB/list/ObjectListView.aspx</a></p> <p>call GetScrollInfo:</p> <pre><code> private const int SIF_RANGE = 0x0001; private const int SIF_PAGE = 0x0002; private const int SIF_POS = 0x0004; private const int SIF_DISABLENOSCROLL = 0x0008; private const int SIF_TRACKPOS = 0x0010; private const int SIF_ALL = (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS); private const int SB_HORZ = 0; private const int SB_VERT = 1; [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)] public static extern bool GetScrollInfo(IntPtr hWnd, int fnBar, SCROLLINFO scrollInfo); public static SCROLLINFO GetFullScrollInfo(ListView lv, bool horizontalBar) { int fnBar = (horizontalBar ? SB_HORZ : SB_VERT); SCROLLINFO scrollInfo = new SCROLLINFO(); scrollInfo.fMask = SIF_ALL; if (GetScrollInfo(lv.Handle, fnBar, scrollInfo)) return scrollInfo; else return null; } </code></pre> <p>with this data struct:</p> <pre><code> [StructLayout(LayoutKind.Sequential)] public class SCROLLINFO { public int cbSize = Marshal.SizeOf(typeof(SCROLLINFO)); public int fMask; public int nMin; public int nMax; public int nPage; public int nPos; public int nTrackPos; } </code></pre> <p>the nMax gives the total max scroll value including the scroll handle itself, so the actually useful max value is nMax - nPage, where nPage is the size of the scroll handle.</p> <p>This works great !</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload