Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4625040
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:12:56+00:00 2026-05-22T03:12:56+00:00

How do I know when the WinForms ListView scrollbar reaches it’s bottom? When this

  • 0

How do I know when the WinForms ListView scrollbar reaches it’s bottom?

When this happens, I want the listview to be populated with more data (which is endless in theory in my case).

The OnScroll event gives me the scroll value from the top, but I have no way of knowing if the user can scroll any further or not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T03:12:57+00:00Added an answer on May 22, 2026 at 3:12 am

    I found an answer using some code from the great ObjectListView code-project:
    http://www.codeproject.com/KB/list/ObjectListView.aspx

    call GetScrollInfo:

        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;
        }
    

    with this data struct:

        [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;
        }
    

    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.

    This works great !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know what this means. Getting this in C# winforms applications: Not a
I'd like to know more about the lifecycle of winforms. I know that the
If not, how can I know which controls are used in winforms, which controls
I want to know, is it possible to have charts and graphs in WinForms
I have this extension method I use in WinForms but would like to know
Anyone know of a good free winforms html editor for .NET. Ideally I would
what is the best way to deploy a winforms app if you know you
Is it possible to create a toggle button in C# WinForms? I know that
Know of any good libraries for this? I did some searches and didn't come
Is it possible to have variable-height rows within a WinForms ListView in Details mode?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.