# RulerBar Class

> The RulerBar class represents a Windows Forms tool bar which can be used to show or to set indents, margins and tabs of a Windows Forms TextControl. It is inherited from the System.Windows.Forms.Control class. The following describes only the properties, methods and events defined through the RulerBar class. For a list of properties, methods and events inherited from the System.Windows.Forms.Control class see the .NET Framework reference.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **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
- **Inherits:** `System.Windows.Forms.Control`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > RulerBar Class
- **966 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/llms-full.txt

---

### Description

The RulerBar class represents a Windows Forms tool bar which can be used to show or to set indents, margins and tabs of a Windows Forms [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/llms-full.txt). It is inherited from the `System.Windows.Forms.Control` class. The following describes only the properties, methods and events defined through the `RulerBar` class. For a list of properties, methods and events inherited from the `System.Windows.Forms.Control` class see the .NET Framework reference.

### Syntax

```csharp
public class RulerBar : Control
```

```vbnet
Public Class RulerBar
    Inherits Control
```

### Examples

The following example creates a Ruler Bar instance and configures its alignment setting for a document workflow.

```csharp
using RulerBar rulerBar = new();
rulerBar.Alignment = RulerBarAlignment.Top;
```

```vbnet
Dim rulerBar As New RulerBar()
rulerBar.Alignment = RulerBarAlignment.Top
```

---

## In This Section

- [RulerBar.Alignment Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/alignment-property/llms-full.txt): 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.
- [RulerBar.BorderStyle Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/borderstyle-property/llms-full.txt): Gets or sets the border style of the ruler bar.
- [RulerBar.DisplayColors Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/displaycolors-property/llms-full.txt): Gets or sets the colors of the ruler bar. These colors are only used when the BorderStyle property has been set to ColorScheme. The property value is an object of the type RulerBar.Colors.
- [RulerBar.EnablePageMargins Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/enablepagemargins-property/llms-full.txt): Enables or disables the setting of page margins. If the property's value is true, the setting of page margins is enabled.
- [RulerBar.FormulaMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/formulamode-property/llms-full.txt): Gets or sets a value specifying whether the ruler bar shows cell references when the current input position is in a table cell. Depending on the TextControl.FormulaReferenceStyle property cell references are shown either in the A1 or in the R1C1 notation. This property has no effect when the BorderStyle property has been set to RulerBarBorderStyle.Simple3D or RulerBarBorderStyle.Fixed3D.
- [RulerBar.ReadOnly Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/readonly-property/llms-full.txt): Gets or sets a value determining the ruler bar's read only mode. When the ruler bar is set to read only, it still shows all formatting attributes of the connected TextControl, but formatting attributes cannot be changed.
- [RulerBar.ResetDisplayColors Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/resetdisplaycolors-method/llms-full.txt): Resets all display colors of a ruler bar to their system dependent default values.
- [RulerBar.ScaleUnit Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/scaleunit-property/llms-full.txt): Gets or sets the unit of the ruler bar's scale.

---

## Nearby

- **Previous:** [PermanentControlChar Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/permanentcontrolchar/enumeration/llms-full.txt)
- **Next:** [RulerBar.Alignment Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/alignment-property/llms-full.txt)
