Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RichEditView.GetDocumentLayoutPosition(Point) Method

Obtains the page index and the layout position on the page for the specified point.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.RichEdit.v24.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

#Declaration

public PageLayoutPosition GetDocumentLayoutPosition(
    Point point
)

#Parameters

Name Type Description
point Point

A Point object that is the point in control coordinates.

#Returns

Type Description
PageLayoutPosition

A PageLayoutPosition object containing the page index and the position on a page.

#Remarks

The PageLayoutPosition.Position obtained using the GetDocumentLayoutPosition method corresponds to layout element coordinates accessible via the LayoutElement.Bounds property.

#Example

When the mouse hovers over the RichEdit view, this code snippet displays the PageLayoutPosition.PageIndex of the page and the position PageLayoutPosition.Position under the mouse cursor on the page.

void richEditControl1_MouseMove(object sender, MouseEventArgs e)
{
    PageLayoutPosition pos = richEditControl1.ActiveView.GetDocumentLayoutPosition(e.Location);
    if (pos != null)
        this.barStaticItem1.Caption = System.String.Format("Mouse is over page {0}, position {1}", pos.PageIndex, pos.Position);
    else this.barStaticItem1.Caption = "";
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetDocumentLayoutPosition(Point) 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