Width Property

Visual Studio .NET 2003

Specifies the width of an object. Available at design time and run time.

 [Object.]Width[ = nWidth]

Property Values

Specifies the width of an object.


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.

For forms and controls, the values for this property changes as the object is sized by the user or in code. Maximum settings of this property for all objects are system-dependent.

For forms, the Width property specifies the external width of the form, excluding the borders. If the ScrollBars property is set to enable scroll bars, Width does not include space taken up by the scroll bar when it appears.

For controls, the Width property is measured from the center of the control's border so that controls with different border widths align correctly.

Note   The Width property is read-only when it applies to a control contained in a Column object.

The Width property is determined in the unit of measurement specified by the ScaleMode property setting.

See Also

Height Property | Left Property | Move Method | ScaleMode Property | Top Property

Applies To: CheckBox | Column | ComboBox | CommandButton | CommandGroup | Container Object | Control Object | Custom | EditBox | Form | Grid | Image | Label | Line | ListBox | OLE Bound Control | OLE Container Control | OptionButton | OptionGroup | PageFrame | _SCREEN | Shape | Spinner | TextBox | Timer | ToolBar