WordWrap

Returns or sets a value indicating whether a Label control with its AutoSize property set to True expands vertically or horizontally to fit the text specified in its Caption property.

Syntax

object.WordWrap [= boolean]

The parts of the WordWrap property syntax are described in the following table.

Part Description
object An object expression that evaluates to an object.
boolean A Boolean expression specifying whether the Label expands to fit the text, as described in Settings.

Settings

The settings for boolean are described in the following table.

Setting Description
True The text wraps; the Label control expands or contracts vertically to fit the text and the size of the font. The horizontal size does not change.
False (Default). The text does not wrap; the Label expands or contracts horizontally to fit the length of the text and vertically to fit the size of the font and the number of lines.

Remarks

Use this property to determine how a Label control displays its contents. For example, a graph that changes dynamically might have a Label containing text that also changes. To maintain a constant horizontal size for the Label and allow for increasing or decreasing text, set the WordWrap and AutoSize properties to True.

If you want a Label control to expand only horizontally, set WordWrap to False. If you do not want the Label to change size, set AutoSize to False.

Note If AutoSize is set to False, the text always wraps, regardless of the size of the Label control or the setting of the WordWrap property. This may obscure some text because the Label does not expand in any direction.