Height, Width Properties (ActiveX Controls)

       

Return or set the dimensions of an object or the width of the Columns object of a DataGrid control. For the Printer and Screen objects, not available at design time.

Syntax

object.Height [= number]

object.Width [= number]

The Height and Width property syntaxes have these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
number A numeric expression specifying the dimensions of an object, as described in Settings.

Settings

Measurements are calculated as follows:

Remarks

For Form, Printer, and Screen objects, these properties are always measured in twips. For a form or control, the values for these properties change as the object is sized by the user or by your code. Maximum limits of these properties for all objects are system-dependent.

If you set the Height and Width properties for a printer driver that doesn't allow these properties to be set, no error occurs and the size of the paper remains as it was. If you set Height and Width for a printer driver that allows only certain values to be specified, no error occurs and the property is set to whatever the driver allows. For example, you could set Height to 150 and the driver would set it to 144.

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.

Note   The Height property can't be changed for the DriveListBox control or for the ComboBox control, whose Style property setting is 0 (Dropdown Combo) or 2 (Dropdown List).

For the Columns object of the DataGrid control, Width is specified in the unit of measure of the object that contains the DataGrid. The default value for Width is the value of the DefColWidth property of DataGrid.

For the Picture object, use the ScaleX and ScaleY methods to convert HiMetric units into the scale you need.