Partager via


TextHeight Method

Returns the height of a text string as it would be displayed in the current font.

 [nHeight =] [Form.]TextHeight(cText)

Parameters

  • nHeight
    Returns a value in pixels specifying the height of the text string.

  • cText
    Specifies the character string for which the text height is determined.

Remarks

Applies To: Form | _SCREEN

The TextHeight method determines the amount of vertical space required to display cText. The height returned includes the leading space above and below the character string, so you can use the height returned to calculate and position multiple lines of text within the form. If cText contains embedded carriage returns, the TextHeight method returns the cumulative height of the lines, including the leading space above and below each line.

See Also

Reference

FontSize Property

ScaleMode Property

TextWidth Method

Other Resources

Methods (Visual FoxPro)

Language Reference (Visual FoxPro)