DoScroll

DoScroll is a method to scroll a grid horizontally and vertically as the user would with the scrollbars. It was introduced with grids in VFP 3, so we were really surprised this method was not extended to forms when forms gained scrollbars in VFP 6.

Usage

grdGrid.DoScroll( nDirection )

Parameter

Value

Meaning

nDirection

0

Simulates a click on the scrollbar up arrow.

1

Simulates a click on the scrollbar down arrow.

2

Simulates a page-up click—clicking in the space above the thumb and below the scroll arrow.

3

Simulates a page-down click—clicking in the space below the thumb and above the scroll arrow.

4

Simulates a click on the left scrollbar arrow.

5

Simulates a click on the right scrollbar arrow.

6

Simulates a form-left click—clicking in the space to the left of the thumb and the right of the scroll arrow.

7

Simulates a form-right click—clicking in the space to the right of the thumb and the left of the scroll arrow.

Omitted or any other number

Ignored.


A useful alternative to including scrollbars on the grid itself, DoScroll can be used to cause the same effect without all the visual interference, or with an alternative user interface. The Scrolled event fires after DoScroll is called, and receives a parameter for direction matching that is set by this method.

Example

grdGrid.DoScroll(0)

See Also

Grid, Scrollbars, Scrolled


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .