LabelExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the Label class.
- C#
- VB.NET
public class LabelExtensions
Public Class LabelExtensions
Methods
AllowHtml<TLabel>(label, value)
Sets the AllowHtml property of the specified Label.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, must inherit from Label. | |
| label | TLabel | The label for which to set the AllowHtml property. |
| value | Boolean | A boolean indicating whether HTML content is allowed in the label text. |
Returns: TLabel. The modified label with the updated AllowHtml property.
This method allows you to enable or disable HTML content in the label text.
myLabel.AllowHtml(true);
AllowMarkdown<TLabel>(label, value)
Sets the AllowMarkdown property of the specified Label.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, must inherit from Label. | |
| label | TLabel | The label for which to set the AllowMarkdown property. |
| value | Boolean | A boolean indicating whether Markdown content is allowed in the label text. |
Returns: TLabel. The modified label with the updated AllowMarkdown property.
This method allows you to enable or disable Markdown content in the label text.
myLabel.AllowMarkdown(true);
AutoEllipsis<TLabel>(label, value)
Sets the AutoEllipsis property of the specified Label.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, must inherit from Label. | |
| label | TLabel | The label for which to set the AutoEllipsis property. |
| value | Boolean | A boolean indicating whether ellipsis characters should be displayed for truncated text. |
Returns: TLabel. The modified label with the updated AutoEllipsis property.
This method allows you to control whether ellipsis characters are shown when the text is truncated.
myLabel.AutoEllipsis(true);
AutoSize<TLabel>(label, value)
Sets the AutoSize property of the specified Label.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, must inherit from Label. | |
| label | TLabel | The label for which to set the AutoSize property. |
| value | Boolean | A boolean indicating whether the label should automatically resize itself to fit its content. |
Returns: TLabel. The modified label with the updated AutoSize property.
This method allows you to control whether the label should automatically resize itself based on its content.
myLabel.AutoSize(true);
AutoToolTip<TLabel>(label, value)
Sets the AutoToolTip property of the specified Label.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, must inherit from Label. | |
| label | TLabel | The label for which to set the AutoToolTip property. |
| value | Boolean | A boolean indicating whether tooltips should be automatically shown for the label. |
Returns: TLabel. The modified label with the updated AutoToolTip property.
This method allows you to enable or disable automatic tooltips for the label.
myLabel.AutoToolTip(true);
BorderStyle<TLabel>(label, borderStyle)
Sets the BorderStyle property of the specified Label.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, must inherit from Label. | |
| label | TLabel | The label for which to set the BorderStyle property. |
| borderStyle | BorderStyle | The BorderStyle value to set for the label. |
Returns: TLabel. The modified label with the updated BorderStyle property.
This method allows you to set the border style for the label.
myLabel.BorderStyle(BorderStyle.FixedSingle);
CharacterChasing<TLabel>(label, characterCasing)
Sets the CharacterCasing property of the specified Label.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, must inherit from Label. | |
| label | TLabel | The label for which to set the CharacterCasing property. |
| characterCasing | CharacterCasing | The CharacterCasing value to set for the label text. |
Returns: TLabel. The modified label with the updated CharacterCasing property.
This method allows you to control the character casing for the text displayed in the label.
myLabel.CharacterCasing(CharacterCasing.Upper);
SelfSize<TLabel>(label, value)
Sets the SelfSize property of the specified Label.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, must inherit from Label. | |
| label | TLabel | The label for which to set the SelfSize property. |
| value | Boolean | A boolean indicating whether the label should automatically adjust its size. |
Returns: TLabel. The modified label with the updated SelfSize property.
This method allows you to specify whether the label should automatically adjust its size based on its content.
myLabel.SelfSize(true);
TextAlign<TLabel>(label, alignment)
Sets the text alignment for the specified Label control.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, which must inherit from Label. | |
| label | TLabel | The label for which to set the text alignment. |
| alignment | ContentAlignment | The alignment to be applied to the label's text, specified as a ContentAlignment value. |
Returns: TLabel. The label with the updated text alignment.
This method allows you to specify how the text is aligned within the label's bounds.
myLabel.TextAlign(ContentAlignment.MiddleCenter);
UseMnemonic<TLabel>(label, value)
Sets the UseMnemonic property of the specified Label.
| Parameter | Type | Description |
|---|---|---|
| TLabel | The type of the label, must inherit from Label. | |
| label | TLabel | The label for which to set the UseMnemonic property. |
| value | Boolean | A boolean indicating whether mnemonic characters are used in the label text. |
Returns: TLabel. The modified label with the updated UseMnemonic property.
This method allows you to enable or disable the use of mnemonic characters in the label text.
myLabel.UseMnemonic(true);