# RibbonTextBox.TextAlign Property

> Gets or sets how text is aligned in the text box. The default value is HorizontalAlignment.Left.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.Windows.Forms.Ribbon`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.Windows.Forms.Ribbon > RibbonTextBox.TextAlign Property
- **331 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbontextbox/textalign-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbontextbox/textalign-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbontextbox/textalign-property/llms-full.txt

---

### Description

Gets or sets how text is aligned in the text box. The default value is HorizontalAlignment.Left.

### Syntax

```csharp
public System.Windows.Forms.HorizontalAlignment TextAlign { get; set; }
```

```vbnet
Public Property TextAlign As System.Windows.Forms.HorizontalAlignment
```

### Examples

The following example uses `RibbonTextBox.TextAlign` to configure text align as part of the ribbon text box workflow. The change is then applied to the active document or user interface.

```csharp
ribbonTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
ribbonTextBox.Update();
```

```vbnet
ribbonTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
ribbonTextBox.Update()
```

---

## Nearby

- **Previous:** [RibbonTextBox.Text Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbontextbox/text-property/llms-full.txt)
- **Next:** [RibbonTextBox.TextBoxLabel Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbontextbox/textboxlabel-property/llms-full.txt)
