# ParagraphFormat.Direction Property

> Gets or sets the writing direction. A paragraph's writing direction can be either left to right or right to left.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 20.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.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 Windows Forms > Reference > TXTextControl > ParagraphFormat.Direction Property
- **733 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/paragraphformat/direction-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/paragraphformat/direction-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/paragraphformat/direction-property/llms-full.txt

---

### Description

Gets or sets the writing direction. A paragraph's writing direction can be either left to right or right to left.

### Syntax

```csharp
public Direction Direction { get; set; }
```

```vbnet
Public Property Direction As Direction
```

### Members

| Value | Description |
|---|---|
| LeftToRight | The writing direction is left to right, which means that blocks of text with left to right and right to left characters are ordered from left to right. |
| RightToLeft | The writing direction is right to left, which means that blocks of text with left to right and right to left characters are ordered from right to left. |

### Examples

The following example applies paragraph layout to selected report text by using `ParagraphFormat.Direction`.

```csharp
textControl.Text = "First item\nSecond item\nThird item";
textControl.Select(0, textControl.Text.Length);
ParagraphFormat paragraphFormat = textControl.Selection.ParagraphFormat;

paragraphFormat.Direction = Direction.LeftToRight;
Console.WriteLine($"Direction used by Paragraph Format: {paragraphFormat.Direction}");

textControl.Selection.ParagraphFormat = paragraphFormat;
```

```vbnet
textControl.Text = "First item" & vbCrLf & "Second item" & vbCrLf & "Third item"
textControl.Select(0, textControl.Text.Length)
Dim paragraphFormat As ParagraphFormat = textControl.Selection.ParagraphFormat

paragraphFormat.Direction = Direction.LeftToRight
Console.WriteLine($"Direction used by Paragraph Format: {paragraphFormat.Direction}")

textControl.Selection.ParagraphFormat = paragraphFormat
```

### Remarks

The property's default value is Direction.LeftToRight.

The property returns its default value, if the text selection contains multiple paragraphs with mixed direction. The [Selection.IsCommonValueSelected](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/iscommonvalueselected-method/llms-full.txt) method can be used to check for mixed attributes.

---

## Nearby

- **Previous:** [ParagraphFormat Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/paragraphformat/constructor/llms-full.txt)
- **Next:** [ParagraphFormat.Frame Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/paragraphformat/frame-property/llms-full.txt)
