WinXScroll_SetPage


WinXScroll_SetPage (hWnd, direction, DOUBLE mul, constant, scrollUnit)

Sets the page mapping function for a scrollbar associate with a window

Parameter Description
hWnd The handle to the window the scrollbar belongs to
direction The direction of the scrollbar, see remarks for more info
DOUBLE mul The constant to multiply the window size by to get the page size, see remarks for more info
constant The constant to add to adjust the page size, see remarks for more info
scrollUnit The number of units to scroll when the scrollbar arrow is clicked

Returns

$$TRUE on success or $$FALSE on fail

Remarks

The direction parameter identifies the scrollbar to set the page size for. Possible values are:

$$DIR_HORIZ
The horizontal scrollbar
$$DIR_VERT
The vertical scrollbar

The page mapping function turns the size (width or height depending on the scrollbar) of the window into a page size. It does this by multiplying the size of the window by a constant, then adding another constant. In other words, it is a linear function of the form page = mx+c.

In this way, you can define the scrolling units to be whatever is convienient. The only requirement is that you can use a linear function to map between pixels and the scrolling units.

Examples

'Set the page size to be the same as the window size for both scrollbars
'and set the distance to scroll when the arrows are clicked to 10 pixels
WinXScroll_SetPage (#hMain, $$DIR_VERT, 1, 0, 10)
WinXScroll_SetPage (#hMain, $$DIR_HORIZ, 1, 0, 10)

Related Links

Scrolling
WinXScroll_Show
WinXScroll_SetRange