Width

This property uses the scale units of a control’s container to return or set the width of a control or Form.

Syntax

object.Width [= number]

Parameters

object
Object expression that evaluates to a control or Form object.
number
Numeric expression that specifies the dimensions of an object, as described in Settings.

The following list shows how to calculate measurements:

Form
The external width of the form, including the borders and title bar.
Control
The width of a control, measured from the center of the control's border so that controls with different border widths align correctly.
Screen
The width of the screen. Unavailable at design time and read-only at run time.

Remarks

For Form and Screen objects, the Width property is always measured in twips. For a form or control, the value for this property changes as the object is sized by a user or by your code. Maximum limits of these properties for all objects are system-dependent.

Use the Height, Width, Left, and Top properties for operations or calculations based on an object's total area, such as sizing or moving the object. Use the ScaleLeft, ScaleTop, ScaleHeight, and ScaleWidth properties for operations or calculations based on an object's internal area, such as drawing or moving objects within another object.

For the Picture object, use the ScaleX and ScaleY methods to convert HiMetric units into the scale you need.