Type: Real
Availability: Read or write at any time
The width property of the Window class contains the dimensions of an object.
Width measurements are calculated by using the following.
For a Form, the external width of the form, including the borders and title bar
For a Control, the external width of the control
For a form, the width property is always in pixels.
If the value of the width property plus the value of the left property is greater than 32,767 pixels, the resulting window extents may be unpredictable.
For a control, the scaleMode property units of the parent control determine the width. The scaleMode property defaults to pixels. For a form or control, the value for the width property changes as the object is sized by the user or by logic.
The maximum limit for all objects is system-dependent.
Windows limits forms and controls to a maximum width of 32,767 pixels. Setting a value larger than the maximum results in a value of 32,767 pixels being used.
The code fragments in the following examples show the use of the width property.
tblPortfolio.columnWidth[1] := tblPortfolio.width.Integer div 3 - 12; height := width / 1.5; // Make control a rectangle btn.width := clientWidth / ButtonWidthRatio;
See also the parentAspect property.