# TextAlignment
{: .no_toc }

Horizontal and vertical alignment of text drawn inside a control's bounding rectangle. Used by [**TextRendering.Alignment**](/tB/Packages/CustomControls/Styles/TextRendering.md#alignment); each member combines one of three vertical positions (top, middle, bottom) with one of three horizontal positions (left, centre, right).

| Constant | Value | Description |
|----------|-------|-------------|
| **tbAlignTopLeft**{: #tbAlignTopLeft } | 0 | Top edge, left-aligned. |
| **tbAlignTopCenter**{: #tbAlignTopCenter } | 1 | Top edge, horizontally centred. |
| **tbAlignTopRight**{: #tbAlignTopRight } | 2 | Top edge, right-aligned. |
| **tbAlignMiddleLeft**{: #tbAlignMiddleLeft } | 3 | Vertically centred, left-aligned. |
| **tbAlignMiddleCenter**{: #tbAlignMiddleCenter } | 4 | Vertically centred, horizontally centred. The default for newly-constructed [**TextRendering**](/tB/Packages/CustomControls/Styles/TextRendering.md) objects. |
| **tbAlignMiddleRight**{: #tbAlignMiddleRight } | 5 | Vertically centred, right-aligned. |
| **tbAlignBottomLeft**{: #tbAlignBottomLeft } | 6 | Bottom edge, left-aligned. |
| **tbAlignBottomCenter**{: #tbAlignBottomCenter } | 7 | Bottom edge, horizontally centred. |
| **tbAlignBottomRight**{: #tbAlignBottomRight } | 8 | Bottom edge, right-aligned. |

The padding added around the text by [**TextRendering.Padding**](/tB/Packages/CustomControls/Styles/TextRendering.md#padding) is applied first; the alignment then positions the text inside the padded region.

![Nine labels of the same size, each with its TextAlignment value's name set at the place that value gives: along the top edge, through the middle and along the bottom edge, at the left, in the centre and at the right](/Reference/Built-In/CustomControls/Enumerations/Images/TextAlignment.png){:width="677" height="373"}
