I had this same problem some time ago. We were trying to make a virtual list box that could handle ANY number of items. The scroll bar is the wrinkle. You can't set it or size it without knowing the size of the list.
My conclusion was this: A list of more than 100 or so items on screen is really useless for humans. It's so long nobody will read the entire thing. It's good enough to present what you can load into memory (and you can count this result set easily). We eliminated the need for this because in reality it wasn't very useful. "When in doubt, chop it out."