# Rulers and Status Bar

> Configure WPF RulerBar and StatusBar in XAML: scale unit, page margins, formula cell references, status areas, labels, fonts, messages and visibility.

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

---

Rulers for margins, indents and tab stops, and a status bar with the page, line and zoom factor, are what users expect around a document. In a WPF window, the `RulerBar` and the `StatusBar` of TX Text Control provide them as XAML elements, and most of their settings are attributes you write next to the element. What follows covers the horizontal and the vertical ruler, their scale and cell references, the areas and labels of the status bar, and showing or hiding the bars.

The bars are placed and connected for the first time in [Connect Rulers, Toolbars, and a Status Bar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-editor/rulers-toolbars/llms-full.txt).

![The View tab of the WPF TX Words sample with the Toolbars group, whose check boxes show the horizontal ruler, the vertical ruler and the status bar, and the horizontal ruler below the ribbon.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-wpf/view-tab-toolbars.e1712c67.webp)

### Place and Connect the Bars

The bars are connected by name: the `TextControl` holds the `x:Name` of each bar in [RulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/rulerbar-property/llms-full.txt), [VerticalRulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/verticalrulerbar-property/llms-full.txt) and [StatusBar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/statusbar-property/llms-full.txt), and an empty string means that no bar is connected. The same [RulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/rulerbar/llms-full.txt) class serves as horizontal and vertical ruler: the vertical ruler is the one named in `VerticalRulerBar`, docked at the left and stretched vertically. [Connect the Bars in XAML](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-editor/rulers-toolbars/#connect-the-bars-in-xaml) in the tutorial Connect Rulers, Toolbars, and a Status Bar declares and connects the bars in a `DockPanel`, and [Connecting Ribbon Tabs in XAML](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/ribbon-ui/ribbon-xaml/llms-full.txt) shows them in a complete ribbon window.

### Ruler Settings

Each property can be written as an attribute in the XAML or set in code:

| Property | Values and effect |
|---|---|
| [ScaleUnit](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/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-wpf/reference/txtextcontrol-wpf/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-wpf/reference/txtextcontrol-wpf/rulerbar/formulamode-property/llms-full.txt) | Cell references while the input position is in a table cell: `None`, the default; `Always`; `Auto`, only in cells with a formula; `Fixed`, relative to the cell where the mode was switched on |
| [BorderStyle](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/rulerbar/borderstyle-property/llms-full.txt) | `ColorScheme`, `Flat`, `FixedSingle`, `Simple3D` or `Fixed3D` |

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

Unlike the Windows Forms ruler, the WPF `RulerBar` has no `ReadOnly` property; to keep users from changing the document, set the `EditMode` of the `TextControl` instead.

### Status Bar Settings

The [StatusBar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/llms-full.txt) shows information about the input position and the document in areas that you switch on and off:

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

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

The reference of the WPF status bar lists a few more properties:

- **Font.** [FontFamily](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/fontfamily-property/llms-full.txt), [FontSize](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/fontsize-property/llms-full.txt), `FontStyle` and `FontWeight` are dependency properties, so they can be set by a style or a binding.
- **A message of your own.** [Text](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/text-property/llms-full.txt) shows your text until a status of the connected `TextControl` changes, for example "Document saved" after a save command.

#### Labels of the Areas

[PageText](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/pagetext-property/llms-full.txt), [PageCounterText](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/pagecountertext-property/llms-full.txt), [SectionText](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/sectiontext-property/llms-full.txt), [SectionCounterText](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/sectioncountertext-property/llms-full.txt), [LineText](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/linetext-property/llms-full.txt) and [ColumnText](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/columntext-property/llms-full.txt) set the labels in front of the values, such as **Page:**, for example to translate them. [BorderStyle](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/statusbar/borderstyle-property/llms-full.txt) takes the values of the ruler and `VerticalColorScheme`, which the TX Words sample uses.

### Configure Both in XAML

The following elements set up a ruler in centimeters with page margins and cell references, and a status bar with sections, key states, a zoom track bar and German labels:

```xml
<WPF:RulerBar x:Name="rulerBar" DockPanel.Dock="Top"
              ScaleUnit="Centimeter" EnablePageMargins="True" FormulaMode="Auto"/>
<WPF:StatusBar x:Name="statusBar" DockPanel.Dock="Bottom"
               ShowSection="True" ShowSectionCounter="True"
               ShowKeyStates="True" ShowZoomTrackBar="True"
               PageText="Seite" LineText="Zeile" ColumnText="Spalte"
               SectionText="Abschnitt" BorderStyle="VerticalColorScheme"/>
```

In code, the enumerations are in the `TXTextControl` namespace, for example `rulerBar.ScaleUnit = TXTextControl.RulerBarScaleUnit.Centimeter;` and `statusBar.BorderStyle = TXTextControl.StatusBarBorderStyle.VerticalColorScheme;`.

### Show and Hide the Bars

- **Users, with the ribbon.** The **Toolbars** group of the [RibbonViewTab](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/ribbonviewtab/llms-full.txt) has check boxes for the horizontal ruler, the vertical ruler and the status bar, named `TXITEM_HorizontalRuler`, `TXITEM_VerticalRuler` and `TXITEM_StatusBar` in [RibbonViewTab.RibbonItem](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/ribbonviewtab/ribbonitem-enumeration/llms-full.txt). Remove them as described in [Built-in Ribbon Tabs](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/ribbon-ui/ribbon/llms-full.txt) if the bars should always be visible.
- **Your code.** The bars are WPF elements, so `verticalRulerBar.Visibility = Visibility.Collapsed;` hides the vertical ruler. To detach a bar from the editor instead, set the matching property of the `TextControl` to an empty string.

The colors of the bars, set with `DisplayColors` when the border style is `ColorScheme`, are covered in [Styles, Resources, and Themes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/ribbon-ui/themes/llms-full.txt).

### Next Steps

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

---

## Nearby

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