Width Property

Home Page (Objects)OverviewFAQReference

Applies to: Application object, TextWindow object, Window object

Gets or sets the width of a window in pixels.

Syntax

object**.Width** [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above. When you access the Width property of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.

value

A Long that sets the width of the window.

Remarks

The Width property has the Long type.

If object is the Application object, the Width property gets or sets the distance in pixels between the left and right edge of the main application window. If object is a Window object, the Width property gets or sets the distance in pixels between the left and right edge of that window.

Note   Floating window coordinates are relative to the upper-left corner of the screen. Docking window coordinates are relative to the upper-left corner of the client area of the application's frame window. Multiple Document Interface (MDI) child window coordinates are relative to the child window client area. (This area is inside the frame but does not include the docking sites.)

Example

The following example gets the width of the active window:

Dim width
width = ActiveWindow.Width

See Also   Height property, Left property, Top property.