# RulerBar.Alignment Property

> Gets or sets a value specifying the alignment of the ruler bar in the document. Depending on the alignment either a horizontal or a vertical ruler is displayed. This property is automatically set to Top, if the control's Dock property is set to to Top or Bottom. It is automatically set to Left, if the control's Dock property is set to to Left or Right.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 13.0
- **Namespace:** `TXTextControl`
- **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 > RulerBar.Alignment Property
- **389 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/alignment-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/alignment-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/alignment-property/llms-full.txt

---

### Description

Gets or sets a value specifying the alignment of the ruler bar in the document. Depending on the alignment either a horizontal or a vertical ruler is displayed. This property is automatically set to `Top`, if the control's `Dock` property is set to to `Top` or `Bottom`. It is automatically set to `Left`, if the control's `Dock` property is set to to `Left` or `Right`.

### Syntax

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

```vbnet
Public Property Alignment As RulerBarAlignment
```

### Members

| Value | Description |
|---|---|
| Left | The ruler bar is displayed with a vertical ruler. |
| Top | The ruler bar is displayed with a horizontal ruler. |

### Examples

The following example uses `RulerBar.Alignment` to configure alignment as part of the ruler bar workflow. The change is then applied to the active document or user interface.

```csharp
rulerBar.Alignment = RulerBarAlignment.Top;
rulerBar.Update();
```

```vbnet
rulerBar.Alignment = RulerBarAlignment.Top
rulerBar.Update()
```

---

## Nearby

- **Previous:** [RulerBar Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/llms-full.txt)
- **Next:** [RulerBar.BorderStyle Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/borderstyle-property/llms-full.txt)
