# FrameBase.Alignment Property

> Gets or sets the frame's horizontal alignment when it is anchored to a paragraph.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 15.1
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > FrameBase.Alignment Property
- **669 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framebase/alignment-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framebase/alignment-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framebase/alignment-property/llms-full.txt

---

### Description

Gets or sets the frame's horizontal alignment when it is anchored to a paragraph.

### Syntax

```csharp
public HorizontalAlignment Alignment { get; set; }
```

```vbnet
Public Property Alignment As HorizontalAlignment
```

### Members

| Value | Description |
|---|---|
| Left | The frame is left aligned. |
| Right | The frame is right aligned. |
| Center | The frame is centered. |
| Justify | This value cannot be used with this property. |

### Examples

The following example adds a callout frame and works with it through the common frame API by using `FrameBase.Alignment`.

```csharp
TextFrame callout = new(new System.Drawing.Size(3000, 1200)) { Name = "Callout" };
textControl.TextFrames.Add(callout, TextFrameInsertionMode.DisplaceText);
FrameBase frameBase = callout;

frameBase.Alignment = TXTextControl.HorizontalAlignment.Center;
Console.WriteLine($"Alignment used by Frame Base: {frameBase.Alignment}");
```

```vbnet
Dim callout As New TextFrame(New System.Drawing.Size(3000, 1200)) With { .Name = "Callout" }
textControl.TextFrames.Add(callout, TextFrameInsertionMode.DisplaceText)
Dim frameBase As FrameBase = callout

frameBase.Alignment = TXTextControl.HorizontalAlignment.Center
Console.WriteLine($"Alignment used by Frame Base: {frameBase.Alignment}")
```

### Remarks

If the image or text frame has another [Location](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framebase/location-property/llms-full.txt) than left, right or center, this property returns zero.

---

## Nearby

- **Previous:** [FrameBase Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framebase/llms-full.txt)
- **Next:** [FrameBase.Bounds Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framebase/bounds-property/llms-full.txt)
