top

Type: Real

Availability: Read or write at any time

The top property of the Window class contains the distance between the internal top edge of an object and the top edge of the client area of the container (the non-border area). When the parent is a Form class or a BaseControl or Picture control, the top position is also offset by the amount that the parent is scrolled.

The top property for a form is always expressed in pixels.

If the value of the top property plus the value of the height property is greater than 32,767 pixels, the resulting window extents may be unpredictable.

For controls, the top property is expressed in units controlled by the scaleMode property of the parent of the control. The default value of the scaleMode property is pixels. (See also the parentAspect property.)

The value for the top property changes as the object is moved by the user or by logic.

The code fragments in the following examples show the use of the top property.

if scrollBar = ScrollBars_Vertical then
    toolbar.top  := scrollVertPos;
else
    toolbar.left := scrollHorzPos;
endif;
startName.top := theTable.top + theTable.height + 10;

When multiple monitors are running on a workstation and a form is saved in the JADE Painter, the values of the left and top properties are converted to be relative to the top and left of the primary monitor.