PageUp event
Description
Occurs when the user clicks in the open space above the scroll
box (also called the thumb).
Event ID
|
Event ID |
Objects |
|---|---|
|
pbm_sbnpageup |
VScrollBar, VTrackBar |
Parameters
None
Return Values
Long. Return code choices (specify in
a RETURN statement):
-
0 Continue
processing
Usage
When the user clicks in a vertical scroll bar, nothing happens
unless you have scripts that change the scroll bar’s Position
property:
-
For the scroll bar arrows, use the LineUp
and LineDown events. -
For clicks in the scroll bar background above and
below the thumb, use the PageUp and PageDown events. -
For dragging the thumb itself, use the Moved event.
Examples
This code in the PageUp event causes the thumb to move up
when the user clicks on the up arrow of the vertical scroll bar
(the page size is stored in the instance variable ii_pagesize):
|
1 |
IF This.Position < & |
|
1 |
This.MinPosition + ii_pagesize THEN |
|
1 |
   This.Position = MinPosition |
|
1 |
ELSE |
|
1 |
   This.Position = This.Position - ii_pagesize |
|
1 |
END IF |
This example changes the position of the scroll box by a predetermined
page size stored in the instance variable ii_pagesize and
scrolls backwards through a DataWindow control 10 rows for each
page:
|
1 |
long ll_currow, ll_prevrow |
|
1 |
This.Position = This.Position - ii_pagesize |
|
1 |
ll_currow = dw_1.GetRow( ) |
|
1 |
ll_prevrow = ll_currow - 10 |
|
1 |
dw_1.ScrollToRow(ll_prevrow) |
|
1 |
dw_1.SetRow(ll_prevrow) |