Skip to main content

Problem:

Is it possible to track the scroll bar position in a ListView control?

Resolution:

By default the tracking of the vertical scroll bar is turned off in a ListView control.  It is possible to turn this on by making a modification to the ListView user control program.

Load the ListView example in:

     \\NetExpress\\Examples\\Dialog System\\COMMONCONTROLS\\LISTVIEW

open the LVIEWCTL.CBL program and search for the following line:

     01 Data-state         PIC X comp-5 value 0.

change the value to 1 then tracking of the scroll bar position is enabled.  At runtime this will cause a callback in to the "Scrolling section" further on down in the program.  The variable called Numeric-Value will contain the row that has been scrolled to.

Old KB# 2907