Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

SelectionCollection.Unselect(DocumentRange) Method

Unselects a specified range.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.1.Core.dll

Declaration

public void Unselect(
    DocumentRange range
)

Parameters

Name Type Description
range DocumentRange

A DocumentRange to unselect.

Remarks

If the specified range is partially selected (intersects with selected ranges), selections are updated so that the specified range is not selected. If the specified range is not selected, it remains unselected.

Example

document.LoadDocument("SelectionCollection.docx", DocumentFormat.OpenXml)
Dim startPos As Integer = 80
Dim endPos As Integer = document.Tables(0).Rows(1).LastCell.ContentRange.Start.ToInt()
Dim myRange As DocumentRange = document.CreateRange(startPos, endPos - startPos)
document.Selections.Add(myRange)
Dim unselectRange As DocumentRange = document.CreateRange(140, 200)
document.Selections.Unselect(unselectRange)

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