ListBox

ListBoxScroll

Move the list viewport by a row, a page or a thumb drag

Syntax

Signature
xBool        ListBoxScroll( ListBox *listBox, int method );

Arguments

listBox the list box.

method a scroll bar hit code, as returned by ScrollBarHitTest() or by ListBoxHitTest() on the attached bar.

Return value

T on success, or F if the object is NULL.

Description

`HTSCROLLUNITDEC` moves one item toward the beginning and `HTSCROLLUNITINC` moves one item toward the end. `HTSCROLLBLOCKDEC` and `HTSCROLLBLOCKINC` move by the number of visible item rows in the corresponding direction. These movements are bounded by the list.

With a vertical scroll bar attached, `HTSCROLLTHUMBDRAG` follows mouse movement until the left button is released. Use it when the press hits the thumb. Unrecognized method values return `T` without scrolling.

Scrolling changes the first visible item and redraws when it moves. The selected position is independent of the viewport.

See also