🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms
Article #2162

SetScrollRange problems

#2162
From: Carl Christofferson
Date: Fri, 16 Mar 1990 01:05
23 lines
1660 bytes
I have been trying to set the scroll bar range with SetScrollRange() on the
scroll bar of a listbox in one of my dialog boxes and have been getting
unexpected results.  I need to set the range on the list box because I may
have to display extremely large lists to the user in which case I'll have to
delete and add data as the user moves through the list (and I want the scroll
bar to move smoothly from the top for the 1st item to bottom for the last).  
So in SetScrollRange I set hWnd to the handle to the listbox, the nMinPos
to 0 and the nMaxPos to the number of strings to display.  However, I find
that the scroll bar thumb reaches the bottom of the bar before I get to the
bottom of the list (i.e. if there are 60 items to display, the thumb reaches
the bottom on item 40).  (BTW I can display 10 items at a time in the listbox.)
I have set the bRedraw flag both on and off with no difference.  nBar is
SB_VERT.

Can anybody tell me what I'm doing wrong?  Can you use SetScrollRange on a
listbox scroll bar in a dialog box?

Thanks in advance for any help with this!

Carl Christofferson
carlc@mars.SanDiego.NCR.COM
disclaimer:  Any opinions expressed are entirely my own ... 
Technical Details
Message-ID: <2603@ncr-sd.SanDiego.NCR.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!sdsu!ncr-sd!mars!carlc

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!sdsu!ncr-sd!mars!carlc
From: carlc@mars.SanDiego.NCR.COM (Carl Christofferson)
Newsgroups: comp.windows.ms
Subject: SetScrollRange problems
Message-ID: <2603@ncr-sd.SanDiego.NCR.COM>
Date: 16 Mar 90 01:05:56 GMT
Sender: news@ncr-sd.SanDiego.NCR.COM
Reply-To: carlc@mars.SanDiego.NCR.COM (Carl Christofferson)
Organization: NCR Corporation, Rancho Bernardo
Lines: 23