# WaynesLabel class
{: .no_toc }

A static text-display control. Paints a [**Caption**](#caption) string inside its rectangle using the configured [**TextRendering**](#textrendering), on top of a [**BackgroundFill**](#backgroundfill). The label has no interactive states --- appearance is the same whether the mouse is hovering over it or not.

```tb check_build inherits=WaynesForm
Sub New()
    lblHeader.Caption = "Hello, world"
    With lblHeader.TextRendering
        .Font.Size = 14
        .Font.Weight = tbBold
        .Alignment = tbAlignMiddleCenter
        .Fill.ColorPoints.SetSolidColor vbWhite
    End With
    lblHeader.BackgroundFill.ColorPoints.SetSolidColor vbBlue
End Sub
```

Because [**BackgroundFill**](#backgroundfill) and [**TextRendering**](#textrendering) accept the same [**Fill**](/tB/Packages/CustomControls/Styles/Fill.md) gradients and the same [**Outlines**](/tB/Packages/CustomControls/Styles/TextRendering.md#outlines) array as any other control, a label can serve as a banner, header strip, or status panel without dropping a heavier control onto the form. Setting [**TextRendering.OverflowMode**](/tB/Packages/CustomControls/Styles/TextRendering.md#overflowmode) to **tbShrinkToFit** keeps a dynamically-set caption visible even when it is wider than the label:

```tb check_build
With lblHeader.TextRendering
    .Font.Size = 24
    .Font.Weight = tbBold
    .Alignment = tbAlignMiddleCenter
    .OverflowMode = tbShrinkToFit
    .Fill.SetSimplePattern vbWhite, &HCCCCFF, _
            Pattern:=tbGradientNorthToSouth
End With
lblHeader.BackgroundFill.SetSimplePattern &H014C99, &H99CCFF, _
        Pattern:=tbGradientNorthWestToSouthEast
```

## Properties

### Anchors
{: .no_toc }

Which sides of the control are attached to its container during resize. [**Anchors**](/tB/Packages/CustomControls/Styles/Anchors.md). Inherited.

### BackgroundFill
{: .no_toc }

The [**Fill**](/tB/Packages/CustomControls/Styles/Fill.md) that paints the label's entire client area.

### Caption
{: .no_toc }

The text displayed on the label. **String**. Default: `"Label"`.

Syntax: *object*.**Caption** [ = *string* ]

### Dock
{: .no_toc }

How the control is docked inside its container. A member of [**DockMode**](/tB/Packages/CustomControls/Enumerations/DockMode.md). Inherited.

### Height
{: .no_toc }

The control's height in pixels. [**PixelCount**](/tB/Packages/CustomControls/Enumerations/PixelCount.md). Inherited.

### Left
{: .no_toc }

The horizontal offset of the control's left edge from its container, in pixels. [**PixelCount**](/tB/Packages/CustomControls/Enumerations/PixelCount.md). Inherited.

### Name
{: .no_toc }

The unique design-time name of the control on its parent form. **String**. Inherited.

### TextRendering
{: .no_toc }

The [**TextRendering**](/tB/Packages/CustomControls/Styles/TextRendering.md) that controls how the [**Caption**](#caption) is drawn --- font, padding, fill, outlines, alignment, and overflow.

### Top
{: .no_toc }

The vertical offset of the control's top edge from its container, in pixels. [**PixelCount**](/tB/Packages/CustomControls/Enumerations/PixelCount.md). Inherited.

### Visible
{: .no_toc }

Whether the control is currently displayed. **Boolean**. Inherited. Default: **True**.

### Width
{: .no_toc }

The control's width in pixels. [**PixelCount**](/tB/Packages/CustomControls/Enumerations/PixelCount.md). Inherited.
