Width Property

Returns or sets the width of the object in the client area of its container.

Syntax

Object.Width [ = fWidth ]

The Width property syntax has the following parts:

 

Name

Type

Description

Object

Object

An object

fWidth

Float

A number specifying the width of the object in the client area of its containing object.

Comments

The following table describes how the Width property is used:

 

Object

Description

Controls

The Width property is measured from the center of the control's border so that controls with different border heights align correctly. The Width is measured in the scale units of the control's container. If the scale units are not defined, the default is pixels.

AForm

The Width property is measured in the scale units of the ScaleMode property and includes the borders and titlebar. If the scale units are not defined, the default is pixels.

AAxis

The Width property is the number of scale units in external width on the AChart object, including the borders and titlebar. If the scale units are not defined, the default is pixels.

AThumb

The Width property is the number of scale units in external width on the ASlider object, including the borders and titlebar. If the scale units are not defined, the default is pixels.

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.

Example

The following statement changes the AButton's Width so the button is nine units wide on the form:

btn1.Width=9

Applies to

All controls that can be visible at run time and the following classes:

 

AAxis

AForm

AThumb

See Also

Height, Left, ScaleMode, ScaleWidth, Top