.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Box

DocumentLayout.GetElement(DocumentPosition, LayoutType) Method

Gets the layout element of the specified type which relates to the specified position in the document model.

Namespace: DevExpress.XtraRichEdit.API.Layout

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

Declaration

public RangedLayoutElement GetElement(
    DocumentPosition position,
    LayoutType type
)

Parameters

Name Type Description
position DocumentPosition

A DocumentPosition object that specifies the position in the document model.

type LayoutType

A LayoutType enumeration that specifies the type of the requested layout element.

Returns

Type Description
RangedLayoutElement

A RangedLayoutElement class descendant if the specified layout type can be related to a document position; otherwise, an exception is thrown.

Remarks

Important

If the specified layout type cannot be related to a document position (e.g. LayoutType.BookmarkStartBox, LayoutType.BookmarkEndBox), an exception is thrown.

See Also