Back to Devexpress

DocumentLayout.GetPageIndex(LayoutElement) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-documentlayout-dot-getpageindex-x28-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-layoutelement-x29.md

latest3.9 KB
Original Source

DocumentLayout.GetPageIndex(LayoutElement) Method

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

Declaration

csharp
public int GetPageIndex(
    LayoutElement element
)
vb
Public Function GetPageIndex(
    element As LayoutElement
) As Integer

Parameters

NameTypeDescription
elementLayoutElement

A LayoutElement descendant that is the layout element being queried for the parent page.

|

Returns

TypeDescription
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.

winforms-richedit-layout-api-practical-usage/CS/WindowsFormsApplication1/DocumentLayoutHelper/PageLayoutHelper.cs#L14

csharp
int currentPageIndex = currentDocumentLayout.GetPageIndex(currentPage);
int totalPageCount = currentDocumentLayout.GetFormattedPageCount();

winforms-richedit-layout-api/CS/Form1.cs#L68

csharp
// 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.

winforms-richedit-layout-api-practical-usage/VB/WindowsFormsApplication1/DocumentLayoutHelper/PageLayoutHelper.vb#L17

vb
Dim currentPageIndex As Integer = currentDocumentLayout.GetPageIndex(currentPage)
Dim totalPageCount As Integer = currentDocumentLayout.GetFormattedPageCount()

winforms-richedit-layout-api/VB/Form1.vb#L55

vb
' 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

DocumentLayout Class

DocumentLayout Members

DevExpress.XtraRichEdit.API.Layout Namespace