Width Property

Gets or sets the width of the object in pixels at default size, which is the object's size at design-time.

object.Width = [integer]

Where object is an object expression that evaluates to one of the controls in the Applies To list, and integer is the object's width, in pixels.

Client support

   Newlook Smartclient

   Newlook Server

Use

The Height and Width properties can be used to set or get the dimensions of an object when the form is at default size (which is the object's size at design-time).

It is worth noting that these dimensions may not reflect the actual size of the form or control at runtime, if the screen has been re-sized to a size other than the default size.

For objects that are sizable at runtime (DataGrid column object or ListView Column Header), the Width property represents the width, in pixels, of the object at default size when the screen is loaded. The object may be sized by the user at runtime, however the Width property will remain unchanged and it will default to this value each time the form is opened.

The Width property is not affected by an object's Visible property. This property will return a value as if the object were visible.

Auto value

Introduced in Version 11.0.10.

Unmodified labels and menu buttons will return a Width value of 'Auto' in Designer. This indicates that the control will be auto-sized at runtime. When a control is auto-sized, it is rendered at the narrowest possible width to display the caption text at the specified font size. Any whitespace in the caption will be truncated. If an unmodified label or menu control's Width property is accessed at runtime via a script, macro or expression, then it's default design-time value will be returned (this is its default width before auto-sizing has been applied).

Labels and menu button controls will return a numeric Width value in Designer, instead of 'Auto', if any of the following conditions are met:

See Also

Left property | Top property | Height property

Applies To

Check box control

Column object

ColumnHeader object

Combo box control

Command button control

Data control

Date combo box control

DataGrid control

Form object

Frame control

GoogleBarChart control

GoogleMap control

GooglePieChart control

HTML control

IFrame control

ImageList control

Label control

List box control

ListView control

Menu button control

NumericCombo control

Option button control

Panel control

PictureBox control

ProgressBar control

ScrollBars control

SmartNav control (control deprecated in version 10.5)

Tab control

TabPage object

Text box control

TrackBar control

TreeView control

UpDown control


© 2004-2021 looksoftware. All rights reserved.