Paged List Boxes

The standard list box control provides a convenient way for a program to implement a look-up facility for a group of items. It is also tempting to extend this type of use into a method for locating records in a data file. Unfortunately, this doesn't work well when there are too many records in the file. The programmer runs into two main problems:

  1. The standard list box has a limited capacity (64K bytes), usually less than 2000 items.
  2. It takes too long to load the list box with the entire set of items.

Also, if the number of items is very large, the user may have a difficult time locating a particular item. There are two reasons for this:

  1. The resolution of the scroll bar's slider is too coarse.
  2. The search mechanism is too primitive (single-character match on the first byte of the record).

The paged list box is a variation of the standard list box that solves all of these problems. A paged list box works by managing only a limited number of records at a time. When it needs more records, it requests them from the controlling program. Paged list boxes are intended to be used in conjunction with a large, ordered data source, typically records stored in an indexed file.

Compared to a standard list box, a paged list box has the following advantages:

The primary disadvantage of a paged list box is that it's more complicated to program. Also, it's not well suited to handling unordered data.