Skip to main content

How to: Hide or Show ScrollBars and Rulers

By default, the PrintLayoutView displays a complete set of scrollbars and rulers - a pair of rulers (horizontal and vertical) and a pair of scrollbars (horizontal and vertical). Scrollbars are shown when needed, i.e. if a page does not fit into the control’s display area. Default layout of the DraftView provides only the top, horizontal ruler and a pair of scrollbars. The SimpleView comes without rulers.

The following picture illustrates the PrintLayout view of the RichEdit control with scroll bars and rulers. Ruler ticks reflect the current measurement unit that is set for the document. In this example the Document.Unit value is DocumentUnit.Inch.

ScrollBarsRulers

To change the visibility of scrollbars and rulers, use the RichEditControl.Options property. It provides access to various characteristics of the control, among them: the RichEditControlOptionsBase.HorizontalRuler, RichEditControlOptionsBase.VerticalRuler, RichEditControlOptions.HorizontalScrollbar, RichEditControlOptions.VerticalScrollbar.

To change the visibility of ruler and scrollbar elements, adjust the corresponding Visibility property values as required. E.g. to hide the top ruler use the code below:

using DevExpress.XtraRichEdit;
// ...
richEditControl1.Options.HorizontalRuler.Visibility = RichEditRulerVisibility.Hidden;
See Also