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.


public class RulerBar : Control
Public Class RulerBar
  Inherits Control


The following example shows a RulerBar class with its multiple properties.

TXTextControl.RulerBar  rulerBar = new TXTextControl.RulerBar();

rulerBar.Alignment     = TXTextControl.RulerBarAlignment.Top;
rulerBar.BorderStyle   = TXTextControl.RulerBarBorderStyle.Flat;
rulerBar.FormulaMode   = TXTextControl.RulerBarFormulaMode.Auto;
rulerBar.DisplayColors = TXTextControl.RulerBar.Colors.White;
Dim rulerBar As TXTextControl.RulerBar = New TXTextControl.RulerBar()

rulerBar.Alignment     = TXTextControl.RulerBarAlignment.Top
rulerBar.BorderStyle   = TXTextControl.RulerBarBorderStyle.Flat
rulerBar.FormulaMode   = TXTextControl.RulerBarFormulaMode.Auto
rulerBar.DisplayColors = TXTextControl.RulerBar.Colors.White

End Sub


Method Description
ResetDisplayColors Resets all display colors of a ruler bar to their system dependent default values.


Property Description
Alignment Gets or sets a value specifying the alignment of the ruler bar in the document.
BorderStyle Gets or sets the border style of the ruler bar.
DisplayColors Gets or sets the colors of the ruler bar.
EnablePageMargins Enables or disables the setting of page margins.
FormulaMode Gets or sets a value specifying whether the ruler bar shows cell references when the current input position is in a table cell.
ReadOnly Gets or sets a value determining the ruler bar's read only mode.
ScaleUnit Gets or sets the unit of the ruler bar's scale.

Further Reading

Learn more about the TXTextControl.RulerBar Class in the Text Control Blog: