Visual Basic Reference

Left, Top Properties

See Also    Example    Applies To

  • Left returns or sets the distance between the internal left edge of an object and the left edge of its container.

  • Top returns or sets the distance between the internal top edge of an object and the top edge of its container.

Syntax

object.Left [= value]

object.Top [= value]

The Left and Top property syntaxes have these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value A numeric expression specifying distance.

Remarks

For a form, the Left and Top properties are always expressed in twips; for a control, they are measured in units depending on the coordinate system of its container. The values for these properties change as the object is moved by the user or by code. For the CommonDialog and Timer controls, these properties aren't available at run time.

For either property, you can specify a single-precision number.

Use the Left, Top, Height, and Width properties for operations based on an object's external dimensions, such as moving or resizing. Use the ScaleLeft, ScaleTop, ScaleHeight, and ScaleWidth properties for operations based on an object's internal dimensions, such as drawing or moving objects that are contained within the object. The scale-related properties apply only to PictureBox controls and Form and Printer objects.