Rulers and Status Bar
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.

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 shows the same connections in code.
Rulers
A RulerBar 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 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 | Auto chooses inches or millimeters by the current culture; Inch; Centimeter without millimeter marks; Millimeter, which is centimeters with millimeter marks |
| EnablePageMargins | true lets users set the page margins on the ruler |
| FormulaMode | 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 | true keeps showing indents and tabs, but users cannot change them |
| BorderStyle | ColorScheme, Flat, FixedSingle, Simple3D or Fixed3D |
FormulaMode shows references in A1 or R1C1 notation, depending on TextControl.FormulaReferenceStyle, and has no effect with the border styles Simple3D and Fixed3D. Formulas in tables are the subject of Tables and Table Formulas.
Status Bar
The StatusBar shows where the input position is and other information about the document. Each area has a Show property:
| Property | Area |
|---|---|
| ShowPage, ShowPageCounter | The page of the input position and the number of pages |
| ShowSection, ShowSectionCounter | The section of the input position and the number of sections |
| ShowLine, ShowColumn | The line and the column of the input position |
| ShowLanguage | The language of the selection or the input position |
| ShowKeyStates | CAPS LOCK, NUM LOCK and insert or overwrite mode |
| ShowZoom, ShowZoomTrackBar | 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:

Labels of the Areas
Some areas show a label before their value, such as Page: in the picture above. PageText, PageCounterText, SectionText, SectionCounterText, LineText and ColumnText set these texts, for example in the language of your application. BorderStyle 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:
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 has check boxes for the horizontal ruler, the vertical ruler and the status bar. They are the items
TXITEM_HorizontalRuler,TXITEM_VerticalRulerandTXITEM_StatusBarof RibbonViewTab.RibbonItem, which you can remove as described in Built-in Ribbon Tabs 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 theTextControltonull.
Colors of both bars, set through DisplayColors when the border style is ColorScheme, are covered in Themes, Colors, and Icons.
Next Steps
- Toolbars and Mini Toolbars: the button bar and the contextual mini toolbars.
- Viewing, Zooming, and Navigation: zoom and view modes of the editor, which the status bar shows.
- Sections and Page Layout: the sections and page margins that the bars display.
- Right-to-Left UI: the bars in applications for right-to-left languages.