Label
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.
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.
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.
-cf498e271a7bafd75e26f46248b0f0af.png)
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 (&).
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.
-f8123de3dea969d8a29b6d3102a9ec25.png)
AllowHtml
When set to true, the Label's Text property will be interpreted as HTML content, allowing for full customization of the control.
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
| Item | Description |
|---|---|
| Class name | "wisej.web.Label" |
| Theme appearance | "textlabel", see Themes. |
| Child components | "label" is the text container. See JavaScript. |
| Source code | https://github.com/iceteagroup/wisej-js |