GetTextHeight Method

See Also     Examples     Applies To

Calculate the height of the specified text, based on the specified font, font size and font style. The result is measured in units specified by the FontSetUnit() function.

Syntax

object.GetTextHeight (sText, sFontName, nFontSize, nFontStyle)

The GetTextHeight syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
sText Required. String. Text to draw.
sFontName Required. String. The name of the font.
nFontSize Required. Long. The font size in units specified by the FontSetUnit() function.
nFontStyle Optional. FontStyle long value. Default value is 0 (Style Regular). Specifies the style of the typeface. This value must be an element of the FontStyle enumeration or the result of a bitwise OR applied to two or more of these elements.
For example, FontStyleBold OR FontStyleUnderline OR FontStyleStrikeout sets the style as a combination of the three styles.
FontStyle enumeration:
FontStyleStyleRegular = 0.
FontStyleStyleBold = 1.
FontStyleStyleItalic = 2.
FontStyleStyleBoldItalic = 3.
FontStyleStyleUnderline = 4.
FontStyleStyleStrikeout = 8.

Returns

Single. The height of the text measured in units specified by the FontSetUnit() function.

Category

Draw (Text)





© Copyright 2008 GdPicture All rights reserved.
Documentation MAP.