Skip to main content

Label

WATCH & LEARN0:47 · Animated tutorial
7 scenesPlay, pause, or scrub at your own pace

The Wisej.NET Label controls are used to display text or images that cannot be edited by the user. They are used to identify objects on a form—to provide a description of what a certain control will do if clicked, for example, or to display information in response to a run-time event or process in your application. Because the Label control cannot receive focus, it can also be used to create access keys for other controls.

info

For a complete list of properties, methods, and events, see the API documentation.

Features​

AutoSize​

When the AutoSize property is set to true, the Label control will automatically adjust itself to fit the size of its text content.

Label control demonstrating AutoSize property

info

A BorderStyle is applied to the Labels to show the AutoSize functionality.

HTML​

Set AllowHtml to true to interpret the Text value as HTML. This lets you add formatting beyond plain text.

Label control showing HTML formatting with gradient text and emojis

Mnemonics​

Mnemonics can be used to provide shortcuts for form navigation. By pressing ALT + the Mnemonic key on a Label control, the focus will automatically be applied to the control at the next TabIndex. Mnemonic keys are specified with an ampersand (&).

Label control demonstrating mnemonic key functionality

info

Some controls have a built-in Label property, so you can label them without adding a separate Label control. See the following page for details.

How To​

Customize the Appearance​

The Label control is fully customizable through the Font, Text, AllowHtml, and AppearanceKey properties.

Font​

Like most other controls in Wisej.NET, the Label control has a Font property that allows for customization of the size, features, and style of font to use for the control.

Label using Bangers Google Font

AllowHtml​

When set to true, the Label's Text property will be interpreted as HTML content, allowing for full customization of the control.

Label with HTML content applied

Appearance Key​

The AppearanceKey property of the control can be used to give the Label a custom look. Use an appearance already defined in the theme, such as a button appearance, or define a new appearance in a theme mixin.

{
"appearances":
{
"myTextLabel":
{
"inherit": "textlabel",
"states":
{
"default":
{
"styles":
{
"backgroundColor": "blue"
}
}
}
}
}
}

Advanced​

JavaScript Widget​

ItemDescription
Class name"wisej.web.Label"
Theme appearance"textlabel", see Themes.
Child components"label" is the text container. See JavaScript.
Source codehttps://github.com/iceteagroup/wisej-js