officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-documentlayout-dot-getpageindex-x28-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-layoutelement-x29.md
Obtains the index of the page containing the specified layout element.
Namespace : DevExpress.XtraRichEdit.API.Layout
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
public int GetPageIndex(
LayoutElement element
)
Public Function GetPageIndex(
element As LayoutElement
) As Integer
| Name | Type | Description |
|---|---|---|
| element | LayoutElement |
A LayoutElement descendant that is the layout element being queried for the parent page.
|
| Type | Description |
|---|---|
| Int32 |
An integer that is the page index.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetPageIndex(LayoutElement) 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.
int currentPageIndex = currentDocumentLayout.GetPageIndex(currentPage);
int totalPageCount = currentDocumentLayout.GetFormattedPageCount();
winforms-richedit-layout-api/CS/Form1.cs#L68
// Obtain zero-based page index of the page containing the layout element.
int pageIndex = this.richEditControl1.DocumentLayout.GetPageIndex(ltable);
// Check whether the layout element is located at the second page.
Dim currentPageIndex As Integer = currentDocumentLayout.GetPageIndex(currentPage)
Dim totalPageCount As Integer = currentDocumentLayout.GetFormattedPageCount()
winforms-richedit-layout-api/VB/Form1.vb#L55
' Obtain zero-based page index of the page containing the layout element.
Dim pageIndex As Integer = Me.richEditControl1.DocumentLayout.GetPageIndex(ltable)
' Check whether the layout element is located at the second page.
See Also