# LabelWrapper

Namespace: **Wisej.Web**

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

Adds a label to the control it is attached to.

{% tabs %}
{% tab title="C#" %}

```csharp
public class LabelWrapper : INotifyPropertyChanged, IHasPropertyStore, IDisposable, ICloneable, ISerializable
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class LabelWrapper
    Inherits INotifyPropertyChanged
    Implements IHasPropertyStore, IDisposable, ICloneable, ISerializable
```

{% endtab %}
{% endtabs %}

Controls that expose a "Label" property, can display a label in the position defined by [Position](#position). The label can automatically grow to fill the control's width or height (depending on the value of [Position](#position)) using either an absolute [Size](#size), a percentage, or the size that best fits the label. Size modes (values of [SizeType](#sizetype):

* [AutoSize](/api/wisej.web/enumerations/wisej.web.sizetype.md#fields) The size of the label is calculated automatically based in the font and the text. The [MinSize](#minsize) and [MaxSize](#maxsize) are applied when greater than 0.
* [Absolute](/api/wisej.web/enumerations/wisej.web.sizetype.md#fields) The size of the label is set by the value of the [Size](#size) property in pixels. The [MinSize](#minsize) and [MaxSize](#maxsize) are applied when greater than 0.
* [Percent](/api/wisej.web/enumerations/wisej.web.sizetype.md#fields) The size of the label is proportional to the size of the control according to the percentage set in the [Size](#size) property. The [MinSize](#minsize) and [MaxSize](#maxsize) are applied when greater than 0.

This class implements the [INotifyPropertyChanged](https://docs.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged) interface. To listen to property changes, simply attach to the [PropertyChanged](https://docs.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged.propertychanged) event. Pointer events ([MouseClick](/api/wisej.web/general/control.md#mouseclick), [MouseDown](/api/wisej.web/general/control.md#mousedown), etc.) occurring on the label associated with a control can be detected by checking if [Role](/api/wisej.web/general/control/wisej.web.mouseeventargs.md#role) property contains the value "label". There are several additional properties and styles defined in the theme that can affect how the label behaves in the different positions and states set under the appearance key "label-wrapper".

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) LabelWrapper()

Initializes a new instance of the [LabelWrapper](/api/wisej.web/editors/wisej.web.labelwrapper.md) class not bound to any control. It's used by the designer serializer to detect when the Label property is fully inherited.

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) AllowHtml

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the label can contain HTML code.

The default value is false.

### ![](/files/hsR4ok3152WyAf8J2C1u) AllowMarkdown

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the label can contain markdown text.

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoEllipsis

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether to append the ... symbol when the text doesn't fit the label.

The default value is false

### ![](/files/hsR4ok3152WyAf8J2C1u) CharacterCasing

[CharacterCasing](/api/wisej.web/editors/wisej.web.charactercasing.md): Returns or sets the case of the text to display to the user.

The default value is CharacterCasing.Normal

### ![](/files/hsR4ok3152WyAf8J2C1u) Font

[Font](https://docs.microsoft.com/dotnet/api/system.drawing.font): Returns or sets the font of the label.

The default value is null.

### ![](/files/hsR4ok3152WyAf8J2C1u) ForeColor

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color): Returns or sets the color of the label. This property can be defined in the theme.

Default value is Color.Empty

### ![](/files/hsR4ok3152WyAf8J2C1u) MaxSize

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the maximum size of the label in pixels.

When [Position](#position) is [Left](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields) or [Right](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields), [MinSize](#minsize) refers to the maximum width of the label. When [Position](#position) is [Top](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields) or [Bottom](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields), [MinSize](#minsize) refers to the maximum height of the label. Otherwise it's ignored. The default value is 0.

### ![](/files/hsR4ok3152WyAf8J2C1u) MinSize

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the minimum size of the label in pixels.

When [Position](#position) is [Left](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields) or [Right](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields), [MinSize](#minsize) refers to the minimum width of the label. When [Position](#position) is [Top](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields) or [Bottom](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields), [MinSize](#minsize) refers to the minimum height of the label. Otherwise it's ignored. The default value is 0.

### ![](/files/hsR4ok3152WyAf8J2C1u) Padding

[Padding](/api/wisej.web/general/wisej.web.padding.md): Returns or sets the additional padding around the label. This property can be defined in the theme.

Default is a Padding object with properties Left=0, Top=0, Right=0, Bottom=0

### ![](/files/hsR4ok3152WyAf8J2C1u) Position

[LabelPosition](/api/wisej.web/enumerations/wisej.web.labelposition.md): Returns or sets the position of the label in relation to the associated editor control.

The default value is LabelPosition.Top

### ![](/files/hsR4ok3152WyAf8J2C1u) Size

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the size of the label in pixels or percentage, depending on the value of [SizeType](#sizetype).

When [SizeType](#sizetype) is [Absolute](/api/wisej.web/enumerations/wisej.web.sizetype.md#fields), the value of [Size](#size) is in pixels, when it's [Percent](/api/wisej.web/enumerations/wisej.web.sizetype.md#fields) the value is the percentage of the total width or hight. Otherwise it is ignored. When [Position](#position) is [Left](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields) or [Right](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields), [Size](#size) refers to the width of the label. When [Position](#position) is [Top](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields) or [Bottom](/api/wisej.web/enumerations/wisej.web.labelposition.md#fields), [Size](#size) refers to the height of the label. Otherwise it's ignored. The default value is 0.

### ![](/files/hsR4ok3152WyAf8J2C1u) SizeType

[SizeType](/api/wisej.web/enumerations/wisej.web.sizetype.md): Returns or sets how to determine the size of the label.

The default value is SizeType.AutoSize

### ![](/files/hsR4ok3152WyAf8J2C1u) Text

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the text to display in the label. Set to null or empty to disable the label altogether.

The default value is "" (empty string).

### ![](/files/hsR4ok3152WyAf8J2C1u) TextAlign

[ContentAlignment](https://docs.microsoft.com/dotnet/api/system.drawing.contentalignment): Returns or sets the text alignment of the label.

The default value is ContentAlignment.MiddleLeft

### ![](/files/hsR4ok3152WyAf8J2C1u) UseMnemonic

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Return or sets whether to interpret the first character prefixed by & as the accelerator key.

The default value is false.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/editors/wisej.web.labelwrapper.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
