Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.

RichEditView.GetVisiblePagesRange() Method

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

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.RichEdit.v19.1.Core.dll

Declaration

public virtual DocumentRange GetVisiblePagesRange()

Returns

Type Description
DocumentRange

A DocumentRange that is the range containing visible pages.

Example

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)

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetVisiblePagesRange() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also