See Also Example
Apply To
Form, MDI form
Description
Leftdetermines the distance between the internal left edge of an object and the left edge of its container .
Topdetermines the distance between the internal top edge of an object and the top edge of its container.
For a form, the Left and Top properties are always expressed in twips The values for these properties change as the object is moved by the user or by code. For a timer, these properties are not available at run time.
Usage
[form.][control.]Left[ = x ]
[form.][control.]Top[ = y ]
Remarks
For both properties, you can specify a single-precision number.
Use Left and Top, and the Height and Width 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 forms, picture boxes, and the Printer object .
Data Type
Single
Help:
Left Function
Move Method
ScaleHeight, ScaleWidth Properties
ScaleLeft, ScaleTop Properties
ScaleMode Property
Programmer's Guide:
Chapter 15, "Creating Graphics for Applications"
The example sets the size of a form to 75% of screen size, and centers the form when it is loaded. To try this example, paste the code into the Declarations section of a form. Then press F5 and click the form.
Sub Form_Click ()
Width = Screen.Width * .75 ' Set height of form.
Height = Screen.Height * .75 ' Set width of form.
Left = (Screen.Width - Width) / 2 ' Center form horizontally.
Top = (Screen.Height - Height) / 2 ' Center form vertically.
End Sub