Zum Inhalt springen

Programmieren mit dBASE PLUS: Funktionen: scroll

Aus Wikibooks


Gives the appearance of scrolling the client area, of a form or subform, by moving the form's border window over the form's client area.

Syntax

[Bearbeiten]

<oRef>.scroll(<horizontal expN>,<vertical expN> )

<oRef>

An object reference to the Form or SubForm.

<horizontal expN>

Horizontal position of top left corner of the form’s client area

<vertical expN>

Vertical position of top left corner of the form’s client area

Eigenschaft von

[Bearbeiten]

Form, SubForm

Beschreibung

[Bearbeiten]

The scroll( ) method allows you to programatically "scroll" the client area of a form or subform. Relative to the form's initial position at (0,0), the form will move over the client area to a position designated by the values of <horizontal expN> and <vertical expN>.

Calling form.scroll( 10, 10) while form.metric is set to 0 - Chars, moves the form's border window to a position 10 chars to the right and 10 chars down from its initial position of 0, 0. Any controls or data on the form will appear to be scrolled up and to the left of their initial positions.

By subsequently calling form.scroll( 20, 20 ), the form's border window will be scrolled to a position 20 chars down and 20 chars to the right of its initial position, 0,0. Again the form's contents will appear to move up and to the left.

If you next call form.scroll( 5, 5), the form's border window will be scrolled to a position 5 chars down and 5 chars to the right of its initial position, 0, 0. However, since the previous position (20,20) was further down and to the right, the form's contents will appear to be scrolled down and to the right relative to their previous positions.

Note that the coordinates specified are always relative to the initial position of the form, not the form's most recent position.

To use the scroll( ) method, a form or subform's scrollbar must be visible and enabled. This can be done by;

Setting the scrollBar property to 1 (On).

or

Setting the scrollBar property to 2 (Auto), and sizing the form or subform so it's client area, or contents, occupy a larger area than the form itself. This displays and enables the scrollbars.