Skip to main content
Version: 4.1

LabelExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the Label class.

public class LabelExtensions

Methods

Static member AllowHtml<TLabel>(label, value)

Sets the AllowHtml property of the specified Label.

ParameterTypeDescription
TLabelThe type of the label, must inherit from Label.
labelTLabelThe label for which to set the AllowHtml property.
valueBooleanA 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);

Static member AllowMarkdown<TLabel>(label, value)

Sets the AllowMarkdown property of the specified Label.

ParameterTypeDescription
TLabelThe type of the label, must inherit from Label.
labelTLabelThe label for which to set the AllowMarkdown property.
valueBooleanA 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);

Static member AutoEllipsis<TLabel>(label, value)

Sets the AutoEllipsis property of the specified Label.

ParameterTypeDescription
TLabelThe type of the label, must inherit from Label.
labelTLabelThe label for which to set the AutoEllipsis property.
valueBooleanA 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);

Static member AutoSize<TLabel>(label, value)

Sets the AutoSize property of the specified Label.

ParameterTypeDescription
TLabelThe type of the label, must inherit from Label.
labelTLabelThe label for which to set the AutoSize property.
valueBooleanA 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);

Static member AutoToolTip<TLabel>(label, value)

Sets the AutoToolTip property of the specified Label.

ParameterTypeDescription
TLabelThe type of the label, must inherit from Label.
labelTLabelThe label for which to set the AutoToolTip property.
valueBooleanA 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);

Static member BorderStyle<TLabel>(label, borderStyle)

Sets the BorderStyle property of the specified Label.

ParameterTypeDescription
TLabelThe type of the label, must inherit from Label.
labelTLabelThe label for which to set the BorderStyle property.
borderStyleBorderStyleThe 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);

Static member CharacterChasing<TLabel>(label, characterCasing)

Sets the CharacterCasing property of the specified Label.

ParameterTypeDescription
TLabelThe type of the label, must inherit from Label.
labelTLabelThe label for which to set the CharacterCasing property.
characterCasingCharacterCasingThe 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);

Static member SelfSize<TLabel>(label, value)

Sets the SelfSize property of the specified Label.

ParameterTypeDescription
TLabelThe type of the label, must inherit from Label.
labelTLabelThe label for which to set the SelfSize property.
valueBooleanA 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);

Static member TextAlign<TLabel>(label, alignment)

Sets the text alignment for the specified Label control.

ParameterTypeDescription
TLabelThe type of the label, which must inherit from Label.
labelTLabelThe label for which to set the text alignment.
alignmentContentAlignmentThe 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);

Static member UseMnemonic<TLabel>(label, value)

Sets the UseMnemonic property of the specified Label.

ParameterTypeDescription
TLabelThe type of the label, must inherit from Label.
labelTLabelThe label for which to set the UseMnemonic property.
valueBooleanA 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);