Returns or sets the number of units for the vertical measurement of the interior of an object when using graphics methods or when positioning controls.
Object.ScaleHeight [ = fHeight ]
The ScaleHeight property syntax has the following parts:
Name |
Type |
Description |
Object |
Control |
A control object |
fHeight |
Float |
A number specifying the number of units for the vertical measurement of the interior of an object when using graphics methods or when positioning controls. |
This property is not for MDIForm objects.
You can use the ScaleHeight and ScaleWidth properties to create a custom coordinate scale for drawing or printing. For example, the statement ScaleHeight = 100 changes the units of measure of the actual interior height of the form. Instead of the height being n current units (twips, pixels, ...), the height will be 100 user-defined units. Therefore, a distance of 50 units is half the height/width of the object, and a distance of 101 units will be off the object by 1 unit.
Use the ScaleMode property to define a scale based on a standard unit of measurement, such as twips, points, pixels, characters, inches, millimeters, or centimeters.
Setting these properties to positive values makes coordinates increase from top to bottom and left to right. Setting them to negative values makes coordinates increase from bottom to top and right to left.
Using the ScaleHeight and ScaleWidth properties and the related ScaleLeft and ScaleTop properties, you can set up a full coordinate system with both positive and negative coordinates. All four of these Scale properties interact with the ScaleMode property in the following ways:
Setting any other Scale property to any value automatically sets ScaleMode to 0. A ScaleMode of 0 is user-defined.
Setting ScaleMode to a number greater than 0 changes ScaleHeight and ScaleWidth to the new unit of measurement and sets ScaleLeft and ScaleTop to 0. In addition, the CurrentX and CurrentY settings change to reflect the new coordinates of the current point.
You can also use the Scale method to set the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties in one statement.
Note: The ScaleHeight and ScaleWidth properties aren't the same as the Height and Width properties.
The following statement changes the AForm's ScaleHeight to 12 of the units specified by the ScaleMode property:
frm1.ScaleHeight=12
CurrentX, CurrentY, Scale, ScaleLeft, ScaleMode, ScaleTop, ScaleWidth, ScaleX, ScaleY