Returns the length of a text string based on the current font settings of the Text or TextLabel control.

Syntax

<oRef>.getTextExtent(<expC>)

<oRef>

The Text or TextLabel object used to calculate the text size.

<expC>

The string to measure

Property of

Text, TextLabel

Description

The getTextExtent( ) method calculates the width required to display <expC>, in the Text or TextLabel object, using the object’s current font settings. It returns a value in the form’s current metric.

the wrap property

When a Text object's wrap property is false, the value returned by the getTextExtent property will equal the length of the line of text. However, when the wrap property is set to true, the value returned by the getTextExtent property will only reflect the length of the text before a wrap occurs.