SectionLineNumbering Interface
Defines line numbers in the left margin or to the left of each column in the document’s Section.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v19.1.Core.dll
Declaration
Remarks
The SectionLineNumbering interface is accessible via the Section.LineNumbering property of the document’s section.
By default, line numbering is suppressed. To switch line numbering on, set the AllowDisplayLineNumbers property of the required view to true and also set the SectionLineNumbering.CountBy property to any non-zero positive integer value.
Example
The following code snippet enables line numbering for the first section in the loaded document. Line numbering starts at number one and restarts at the new section. Numbers are displayed on each second line and are indented from the text at a distance equal to 0.25 of an inch.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/winforms-richedit-document-api-e5219
document.LoadDocument("Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
document.Unit = DevExpress.Office.DocumentUnit.Inch
Dim sec As Section = document.Sections(0)
sec.LineNumbering.CountBy = 2
sec.LineNumbering.Start = 1
sec.LineNumbering.Distance = 0.25F
sec.LineNumbering.RestartType = LineNumberingRestart.NewSection