Label Control

This control displays text that cannot be edited by the user.

Syntax

Label

The Label control supports the following properties:

Alignment Font Name
Appearance FontBold Parent
AutoSize FontItalic TabIndex
BackColor, ForeColor FontStrikethru Tag
BackStyle FontUnderline Top
BorderStyle FontName UseMnemonic
Caption FontSize Visible
Container Height Width
Enabled Left WordWrap

The Label control supports the following methods:

The Label control supports the following events:

Remarks

To change the text displayed in the label control, use the Caption property. You can set the length of the Caption property up to a maximum of 1024 bytes.

The Alignment property enables you to set the alignment of the text within the Label control to either Left Justify (0—default), Center (1), or Right Justify (2).

By default, when you enter text into the Caption property that exceeds the width of the control, the text wraps to the next line and is truncated if it exceeds the control's height. To enable the control to automatically adjust to the size of its contents, set the AutoSize property to True. The control then expands horizontally to fit the entire contents of the Caption property. To enable the contents to wrap downward and expand vertically, set the WordWrap property to True.