# LabelWrapper

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (3.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/v3.0/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/v3.0/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/v3.0/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/en-us/dotnet/api/system.componentmodel.inotifypropertychanged) interface. To listen to property changes, simply attach to the [PropertyChanged](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged.propertychanged) event. Pointer events ([MouseClick](/api/v3.0/wisej.web/general/control.md#mouseclick), [MouseDown](/api/v3.0/wisej.web/general/control.md#mousedown), etc.) occurring on the label associated with a control can be detected by checking if [Role](/api/v3.0/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".

## Properties

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[Int32](https://docs.microsoft.com/en-us/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/v3.0/wisej.web/enumerations/wisej.web.sizetype.md#fields), the value of [Size](#size) is in pixels, when it's [Percent](/api/v3.0/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/v3.0/wisej.web/enumerations/wisej.web.labelposition.md#fields) or [Right](/api/v3.0/wisej.web/enumerations/wisej.web.labelposition.md#fields), [Size](#size) refers to the width of the label. When [Position](#position) is [Top](/api/v3.0/wisej.web/enumerations/wisej.web.labelposition.md#fields) or [Bottom](/api/v3.0/wisej.web/enumerations/wisej.web.labelposition.md#fields), [Size](#size) refers to the height of the label. Otherwise it's ignored.

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

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

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

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

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

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

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

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


---

# 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/v3.0/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.
