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

SelectionCollection.Unselect(DocumentRange) Method

Unselects a specified range.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v21.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)
See Also