RichEditView.GetVisiblePagesRange() Method
Gets the range encompassing all pages which are shown in the View.
Namespace: DevExpress.XtraRichEdit
Assembly: DevExpress.RichEdit.v26.1.Core.dll
NuGet Package: DevExpress.RichEdit.Core
Declaration
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.CreateGraphicsPageSystem()
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