Skip to main content
A newer version of this page is available. .

RichEditControl.GetBoundsFromPosition(DocumentPosition) Method

Gets the rectangle representing the character at the specified position. Coordinates are in a physical layout.

Namespace: DevExpress.Xpf.RichEdit

Assembly: DevExpress.Xpf.RichEdit.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.RichEdit, DevExpress.Wpf.RichEdit

Declaration

public Rectangle GetBoundsFromPosition(
    DocumentPosition pos
)

Parameters

Name Type Description
pos DocumentPosition

A DocumentPosition representing the position in the document.

Returns

Type Description
Rectangle

A Rectangle representing the area occupied by a character or the System.Drawing.Rectangle.Empty value if the bounds could not be determined. Measured in units that are in effect.

Remarks

You can use the GetBoundsFromPosition method only for the currently visible part of the document. If the specified position is not displayed, the method returns a System.Drawing.Rectangle.Empty value.

The location and size of the resulting rectangle are expressed in measurement units, which are in effect for the current document. To change the unit of measurement, use the Document.Unit property.

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