# LabelExtensions

URL: https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.labelextensions

Version: 4.1
Namespace: **Wisej.Web.Markup**

Assembly: **Wisej.Framework** (4.1.0.0)

Adds [fluent markup](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/markup/markup) extension methods to the [Label](/api/wisej.web/content/wisej.web.label) class.

- C# - VB.NET

```csharp
public class LabelExtensions
```

```visual
Public Class LabelExtensions
```

## Methods

### ![Static member](/img/api/static.png) AllowHtml<TLabel>(label, value)

Sets the AllowHtml property of the specified [Label](/api/wisej.web/content/wisej.web.label) .

| Parameter | Type | Description | **TLabel** | | The type of the label, must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the AllowHtml property. | **value** | [Boolean](https://docs.microsoft.com/dotnet/api/system.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.

```csharp
myLabel.AllowHtml(true);
```

### ![Static member](/img/api/static.png) AllowMarkdown<TLabel>(label, value)

Sets the AllowMarkdown property of the specified [Label](/api/wisej.web/content/wisej.web.label) .

| Parameter | Type | Description | **TLabel** | | The type of the label, must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the AllowMarkdown property. | **value** | [Boolean](https://docs.microsoft.com/dotnet/api/system.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.

```csharp
myLabel.AllowMarkdown(true);
```

### ![Static member](/img/api/static.png) AutoEllipsis<TLabel>(label, value)

Sets the AutoEllipsis property of the specified [Label](/api/wisej.web/content/wisej.web.label) .

| Parameter | Type | Description | **TLabel** | | The type of the label, must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the AutoEllipsis property. | **value** | [Boolean](https://docs.microsoft.com/dotnet/api/system.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.

```csharp
myLabel.AutoEllipsis(true);
```

### ![Static member](/img/api/static.png) AutoSize<TLabel>(label, value)

Sets the AutoSize property of the specified [Label](/api/wisej.web/content/wisej.web.label) .

| Parameter | Type | Description | **TLabel** | | The type of the label, must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the AutoSize property. | **value** | [Boolean](https://docs.microsoft.com/dotnet/api/system.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.

```csharp
myLabel.AutoSize(true);
```

### ![Static member](/img/api/static.png) AutoToolTip<TLabel>(label, value)

Sets the AutoToolTip property of the specified [Label](/api/wisej.web/content/wisej.web.label) .

| Parameter | Type | Description | **TLabel** | | The type of the label, must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the AutoToolTip property. | **value** | [Boolean](https://docs.microsoft.com/dotnet/api/system.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.

```csharp
myLabel.AutoToolTip(true);
```

### ![Static member](/img/api/static.png) BorderStyle<TLabel>(label, borderStyle)

Sets the BorderStyle property of the specified [Label](/api/wisej.web/content/wisej.web.label) .

| Parameter | Type | Description | **TLabel** | | The type of the label, must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the BorderStyle property. | **borderStyle** | [BorderStyle](/api/wisej.web/enumerations/wisej.web.borderstyle) | The [BorderStyle](/api/wisej.web.markup/extensions/wisej.web.markup.labelextensions) 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.

```csharp
myLabel.BorderStyle(BorderStyle.FixedSingle);
```

### ![Static member](/img/api/static.png) CharacterChasing<TLabel>(label, characterCasing)

Sets the CharacterCasing property of the specified [Label](/api/wisej.web/content/wisej.web.label) .

| Parameter | Type | Description | **TLabel** | | The type of the label, must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the CharacterCasing property. | **characterCasing** | [CharacterCasing](/api/wisej.web/editors/wisej.web.charactercasing) | The [CharacterCasing](/api/wisej.web/editors/wisej.web.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.

```csharp
myLabel.CharacterCasing(CharacterCasing.Upper);
```

### ![Static member](/img/api/static.png) SelfSize<TLabel>(label, value)

Sets the SelfSize property of the specified [Label](/api/wisej.web/content/wisej.web.label) .

| Parameter | Type | Description | **TLabel** | | The type of the label, must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the SelfSize property. | **value** | [Boolean](https://docs.microsoft.com/dotnet/api/system.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.

```csharp
myLabel.SelfSize(true);
```

### ![Static member](/img/api/static.png) TextAlign<TLabel>(label, alignment)

Sets the text alignment for the specified [Label](/api/wisej.web/content/wisej.web.label) control.

| Parameter | Type | Description | **TLabel** | | The type of the label, which must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the text alignment. | **alignment** | [ContentAlignment](https://docs.microsoft.com/dotnet/api/system.drawing.contentalignment) | The alignment to be applied to the label's text, specified as a [ContentAlignment](https://docs.microsoft.com/dotnet/api/system.drawing.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.

```csharp
myLabel.TextAlign(ContentAlignment.MiddleCenter);
```

### ![Static member](/img/api/static.png) UseMnemonic<TLabel>(label, value)

Sets the UseMnemonic property of the specified [Label](/api/wisej.web/content/wisej.web.label) .

| Parameter | Type | Description | **TLabel** | | The type of the label, must inherit from [Label](/api/wisej.web/content/wisej.web.label) . | **label** | TLabel | The label for which to set the UseMnemonic property. | **value** | [Boolean](https://docs.microsoft.com/dotnet/api/system.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.

```csharp
myLabel.UseMnemonic(true);
```
