Labels are used to provide descriptive text or other helpful information. Use the Text property to specify the label's text.
You can provide either plain or formatted text (see AllowHtmlString).

A LabelControl can display an image (regular or animated GIF file).
Different images can be provided in the normal, disabled, hovered and pressed states.
To specify images, use the label's appearance settings, accessed via the Appearance, AppearanceDisabled, AppearanceHovered and AppearancePressed properties. For instance, use the LabelControl.Appearance.Image or LabelControl.Appearance.ImageIndex (LabelControlAppearanceObject.ImageIndex) property to provide the default image for the label.
The alignment of an image relative to the label's text is specified by the ImageAlignToText property.

If the ImageAlignToText property is set to ImageAlignToText.None, the alignment of an image within the label is specified by the label's appearance settings (LabelControlAppearanceObject.ImageAlign).
When the LineVisible property is set to true, a LabelControl displays a line in its empty space.

The properties that affect the line display include:
The line is displayed when the label's width/height exceeds the width/height of its text. In some cases, you may need to manipulate the AutoSizeMode property to resize a label to custom dimensions.
A LabelControl participates in the tab order of a form, but does not receive focus (the next control in the tab order receives focus). For instance, if the UseMnemonic property is set to true, and a mnemonic character - the first character after an ampersand (&) - is specified in the label's Text property, when a user presses ALT+ the mnemonic key, focus moves to the next control in the tab order. This feature provides keyboard navigation for a form.
A LabelControl can display a hyperlink. To do so, set the AllowHtmlString property to true and format the required text with the <href></href> tag, as shown below.
C# |
myLabelControl.AllowHtmlString = true;
myLabelControl.Text = "Visit our <href="www.devexpress.com">Web-site</href>";
|
VB |
myLabelControl.AllowHtmlString = true
myLabelControl.Text = "Visit our <href="www.devexpress.com">Web-site</href>"
|
When an end-user clicks the hyperlink, the HyperlinkClick event occurs. Handle it to perform specific operations, depending on the link.
To format text using HTML syntax in cells in container controls (e.g., Data Grid, Tree List, etc.), use the RepositoryItemHypertextLabel in-place editor.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
ControlBase
BaseControl
BaseStyleControl
LabelControl
HyperlinkLabelControl