Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.
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.
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.
grdGrid.DoScroll(0)