windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-32f89ec8.md
Fires when RichEditControl starts or finishes displaying a document page.
Namespace : DevExpress.XtraRichEdit
Assembly : DevExpress.XtraRichEdit.v25.2.dll
NuGet Package : DevExpress.Win.RichEdit
public event EventHandler VisiblePagesChanged
Public Event VisiblePagesChanged As EventHandler
The VisiblePagesChanged event's data class is EventArgs.
The VisiblePagesChanged event occurs when a user scrolls or zooms the editing surface and changes visible pages.
The code sample below moves the caret position to the visible page’s start, so the vertical ruler is always visible:
void richEditControl_VisiblePagesChanged(object sender, EventArgs e)
{
RichEditControl control = sender as RichEditControl;
DocumentRange range = control.ActiveView.GetVisiblePagesRange();
control.Document.CaretPosition = range.Start;
}
Private Sub richEditControl_VisiblePagesChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim control As RichEditControl = TryCast(sender, RichEditControl)
Dim range As DocumentRange = control.ActiveView.GetVisiblePagesRange()
control.Document.CaretPosition = range.Start
End Sub
See Also