# Rulers and Status Bar

> Set up RulerBar and StatusBar in Windows Forms: scale units, page margins, formula cell references, status areas and labels, and showing or hiding the bars.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for Windows Forms > Document Editor > Ribbon and UI > Rulers and Status Bar
- **2191 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/rulers-status-bar/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/rulers-status-bar/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/rulers-status-bar/llms-full.txt

---

Users of a word processor drag indents, margins and tab stops on a ruler and read the page, line and zoom factor from a status bar. In TX Text Control .NET for Windows Forms, the `RulerBar` and the `StatusBar` provide both, next to a ribbon as well as next to a button bar. What follows covers their settings: the scale unit and the page margins of the rulers, cell references in tables, the areas and labels of the status bar, and how users and your code show or hide the bars.

The controls are added to a form in [Add Rulers, Toolbars, and a Status Bar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/rulers-toolbars/llms-full.txt).

![The ribbon of TX Words with the View tab open: its Toolbars group has check boxes for the horizontal ruler, the vertical ruler and the status bar, and the horizontal ruler is visible below the ribbon.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/view-tab-toolbars.b16b72fd.webp)

### Connect the Bars

A `TextControl` works with a horizontal ruler, a vertical ruler and a status bar, each connected through one of its properties: `RulerBar`, `VerticalRulerBar` and `StatusBar`. **Arrange Controls Automatically** sets them, and [Connect the Controls in Code](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-editor/rulers-toolbars/#connect-the-controls-in-code) shows the same connections in code.

### Rulers

A [RulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/llms-full.txt) shows the margins of the page, the indents of the current paragraph and its tab stops, and users set them on the ruler. The same class is used for both rulers: [Alignment](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/alignment-property/llms-full.txt) is `Top` for a horizontal and `Left` for a vertical ruler, and it follows the `Dock` property. A ruler docked at the top or bottom becomes horizontal, one docked at the left or right becomes vertical.

These properties change what a ruler shows and allows:

| Property | Values and effect |
|---|---|
| [ScaleUnit](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/scaleunit-property/llms-full.txt) | `Auto` chooses inches or millimeters by the current culture; `Inch`; `Centimeter` without millimeter marks; `Millimeter`, which is centimeters with millimeter marks |
| [EnablePageMargins](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/enablepagemargins-property/llms-full.txt) | `true` lets users set the page margins on the ruler |
| [FormulaMode](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/formulamode-property/llms-full.txt) | Cell references on the ruler while the input position is in a table cell: `None`, the default; `Always`; `Auto`, only in cells that contain a formula; `Fixed`, relative to the cell where the mode was switched on |
| [ReadOnly](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/readonly-property/llms-full.txt) | `true` keeps showing indents and tabs, but users cannot change them |
| [BorderStyle](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/rulerbar/borderstyle-property/llms-full.txt) | `ColorScheme`, `Flat`, `FixedSingle`, `Simple3D` or `Fixed3D` |

`FormulaMode` shows references in A1 or R1C1 notation, depending on [TextControl.FormulaReferenceStyle](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/formulareferencestyle-property/llms-full.txt), and has no effect with the border styles `Simple3D` and `Fixed3D`. Formulas in tables are the subject of [Tables and Table Formulas](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/tables/llms-full.txt).

### Status Bar

The [StatusBar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/llms-full.txt) shows where the input position is and other information about the document. Each area has a `Show` property:

| Property | Area |
|---|---|
| [ShowPage](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showpage-property/llms-full.txt), [ShowPageCounter](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showpagecounter-property/llms-full.txt) | The page of the input position and the number of pages |
| [ShowSection](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showsection-property/llms-full.txt), [ShowSectionCounter](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showsectioncounter-property/llms-full.txt) | The section of the input position and the number of sections |
| [ShowLine](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showline-property/llms-full.txt), [ShowColumn](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showcolumn-property/llms-full.txt) | The line and the column of the input position |
| [ShowLanguage](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showlanguage-property/llms-full.txt) | The language of the selection or the input position |
| [ShowKeyStates](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showkeystates-property/llms-full.txt) | CAPS LOCK, NUM LOCK and insert or overwrite mode |
| [ShowZoom](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showzoom-property/llms-full.txt), [ShowZoomTrackBar](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/showzoomtrackbar-property/llms-full.txt) | The zoom factor, as a number or as a track bar that also sets it |

The TX Words sample shows sections, pages, line, column, language, key states and the zoom track bar:

![The status bar of TX Words with the areas Section 1/1, Page 1/1, Line 1, Column 0, English (United States), NUM and a zoom track bar at 100%.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-winforms/statusbar-tx-words.094beaed.webp)

#### Labels of the Areas

Some areas show a label before their value, such as **Page:** in the picture above. [PageText](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/pagetext-property/llms-full.txt), [PageCounterText](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/pagecountertext-property/llms-full.txt), [SectionText](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/sectiontext-property/llms-full.txt), [SectionCounterText](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/sectioncountertext-property/llms-full.txt), [LineText](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/linetext-property/llms-full.txt) and [ColumnText](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/columntext-property/llms-full.txt) set these texts, for example in the language of your application. [BorderStyle](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/statusbar/borderstyle-property/llms-full.txt) takes the same values as for the rulers and, in addition, `VerticalColorScheme`.

### Configure Both in Code

The following code, in the constructor of the form after `InitializeComponent`, sets up a horizontal ruler `rulerBar1` in centimeters with page margins and cell references, and a status bar `statusBar1` with section information and German labels:

```csharp
using TXTextControl;

// Ruler: centimeters, page margins and cell references in formula cells
rulerBar1.ScaleUnit = RulerBarScaleUnit.Centimeter;
rulerBar1.EnablePageMargins = true;
rulerBar1.FormulaMode = RulerBarFormulaMode.Auto;

// Status bar: sections, language and German labels
statusBar1.ShowSection = true;
statusBar1.ShowSectionCounter = true;
statusBar1.ShowLanguage = true;
statusBar1.PageText = "Seite";
statusBar1.LineText = "Zeile";
statusBar1.ColumnText = "Spalte";
statusBar1.SectionText = "Abschnitt";
```

The enumerations `RulerBarScaleUnit` and `RulerBarFormulaMode` are in the `TXTextControl` namespace. All properties can also be set in the **Properties** window of the designer.

### Show and Hide the Bars

- **Users, with the ribbon.** The **Toolbars** group of the [RibbonViewTab](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonviewtab/llms-full.txt) has check boxes for the horizontal ruler, the vertical ruler and the status bar. They are the items `TXITEM_HorizontalRuler`, `TXITEM_VerticalRuler` and `TXITEM_StatusBar` of [RibbonViewTab.RibbonItem](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonviewtab/ribbonitem-enumeration/llms-full.txt), which you can remove as described in [Built-in Ribbon Tabs](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/ribbon/llms-full.txt) if users should not hide the bars.
- **Your code.** The bars are Windows Forms controls, so `rulerBar2.Visible = false;` hides the vertical ruler. To detach a bar from the editor instead, set the matching property of the `TextControl` to `null`.

Colors of both bars, set through `DisplayColors` when the border style is `ColorScheme`, are covered in [Themes, Colors, and Icons](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/themes/llms-full.txt).

### Next Steps

- [Toolbars and Mini Toolbars](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/toolbars/llms-full.txt): the button bar and the contextual mini toolbars.
- [Viewing, Zooming, and Navigation](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/viewing/llms-full.txt): zoom and view modes of the editor, which the status bar shows.
- [Sections and Page Layout](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/sections/llms-full.txt): the sections and page margins that the bars display.
- [Right-to-Left UI](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/right-to-left/llms-full.txt): the bars in applications for right-to-left languages.

---

## Nearby

- **Previous:** [Toolbars and Mini Toolbars](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/toolbars/llms-full.txt)
- **Next:** [Sidebar and Panels](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-editor/ribbon-ui/sidebar/llms-full.txt)
