scaleMode

Type: Integer

Availability: Read or write at run time only

The scaleMode property of the Window class contains the unit of measurement for coordinates of an object when using graphics methods or when positioning child controls.

It also determines the units returned during the mouseDown, mouseHover, mouseLeave, mouseMove, and mouseUp events for the form or control.

The settings of the scaleMode property are listed in the following table.

Window Class Constant Value Description
ScaleMode_Pixels 0 Pixel (smallest unit of monitor or printer resolution). This is the default value.
ScaleMode_User 1 Indicates that one or more of the scaleHeight, scaleWidth, scaleLeft, or scaleTop properties are set to custom values.
ScaleMode_Twip 2 Twip (1440 twips per logical inch; 567 twips per logical centimeter).
ScaleMode_Point 3 Point (72 points per logical inch).

Using the related scaleHeight, scaleWidth, scaleLeft, and scaleTop properties, you can create a custom coordinate system with both positive and negative coordinates. These four scale properties interact with the scaleMode property in the following ways.

If the scaleMode property is set to a non-zero value, setting control positions and sizes is expressed in scale mode units. These units are converted (and rounded) internally to pixels, to physically place the control on the screen. When the position or size is accessed, the pixel position or size is converted back to scale mode units, and a slightly different value may result due to the rounding that occurred.

Negative scaleHeight and scaleWidth property values do not apply to window positions and sizes. A window is always drawn across and down from its left and top positions, regardless of the sign of these scale properties.