.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

RichEditView.GetVisiblePagesRange() Method

Gets the range encompassing all pages which are shown in the View.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.RichEdit.v20.2.Core.dll

Declaration

public virtual DocumentRange GetVisiblePagesRange()
Public Overridable Function GetVisiblePagesRange As DocumentRange

Returns

Type Description
DocumentRange

A DocumentRange that is the range containing visible pages.

Examples

This code snippet illustrates the use of the RichEditView.GetVisiblePageLayoutInfos and RichEditView.GetVisiblePagesRange methods to display information about visible pages and indicate page boundaries.

Dim pages As List(Of PageLayoutInfo) = richEditControl1.ActiveView.GetVisiblePageLayoutInfos()
Dim visibleRange As DocumentRange = richEditControl1.ActiveView.GetVisiblePagesRange()

Dim redPen As New Pen(Color.Red, 1)
Dim gr As Graphics = richEditControl1.CreateGraphics()
gr.DrawRectangle(redPen, pages(0).Bounds)

Dim s As String = String.Format("{0} page(s) displayed." & ControlChars.CrLf & "From page {1} which starts at document position {2}." & ControlChars.CrLf & "To page {3} which ends at document position {4}." & ControlChars.CrLf & "First visible page is outlined with red.", pages.Count, pages(0).PageIndex, visibleRange.Start, pages(pages.Count - 1).PageIndex, visibleRange.End)
See Also