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

  • Home
  • SEARCH
  • 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 7936855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:20:23+00:00 2026-06-03T22:20:23+00:00

I’m learning Windows programming, there’s something about scroll bar’s scroll range and page size

  • 0

I’m learning Windows programming, there’s something about scroll bar’s scroll range and page size I don’t understand.

Based On http://msdn.microsoft.com/en-us/library/bb787527.aspx,

MaxScrollPos = MaxRangeValue - (PageSize - 1)

But why? I think it’s better if

MaxScrollPos = MaxRangeValue - PageSize

If I want to display an bitmap whose height is 2000px, and the client height is 600px, It’s natural to set scroll range to [0, 2000], and page size to 600. When the scroll position is 0, the top of the bitmap is displayed; when the scroll position is 1400, the bottom of the bitmap is displayed. But If I do so, I’m able to set the scroll position to 2000 – (600 – 1) = 1401. What does position 1401 mean if 1400 should display the bottom? If “MaxScrollPos” did equal “MaxRangeValue – PageSize”, everything will work perfectly. Now I have to set the scroll range to [0, 1999] to avoid the problem. I think it’s unnatural. So, is there anyone who can explain this?

  • 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-06-03T22:20:26+00:00Added an answer on June 3, 2026 at 10:20 pm

    The range from 0 to 1999 covers 2000 values. It’s a zero-based index, whereas your pixel size count starts from 1.

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

Sidebar

Related Questions

Something I don't enjoy about programming is learning a new API. For example, right
I am learning about C++ and programming to the windows api. My first Hello
I am very interested in learning windows shell programming. So...I searched for books on
Now, I'm learning python but I'm PHP web developer. I don't interest about terminal
I'm learning programing windows applications with C++. Now I'm reading about messages and I'm
I'm currently learning Windows programming through the Win32 API using Petzold's book as a
I am learning Windows 7 mobile.I don't have sql azure software because it's paid
I'm learning java programming in windows operating system. And I'm wondering how can I
We just started learning windows programming in C++. We have to make a program
Where can I start learning Windows Form designing? For example: Microsoft Zune player, Buttons,

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.