The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

SelectionCollection Class

A collection of selections in the document.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

public class SelectionCollection :
    IEnumerable<DocumentRange>,
    IEnumerable
Public Class SelectionCollection
    Implements IEnumerable(Of DocumentRange),
               IEnumerable
public class SelectionCollection :
    IEnumerable<DocumentRange>,
    IEnumerable
Public Class SelectionCollection
    Implements IEnumerable(Of DocumentRange),
               IEnumerable

Remarks

All ranges selected in the document are contained in this collection. To add an item to the collection, select a range with a keyboard or mouse, or use the SelectionCollection.Add method.

To toggle selection, that is to unselect a previously selected range, use the SelectionCollection.RemoveAt method.

To unselect an arbitrary range, use the SelectionCollection.Unselect method.

The SelectionCollection object is accessible using the Document.Selections property.

Examples

document.LoadDocument("SelectionCollection.docx", DocumentFormat.OpenXml)
Dim range1 As DocumentRange = document.CreateRange(80, 100)
Dim range2 As DocumentRange = document.CreateRange(300, 100)
Dim startPos3 As Integer = document.Tables(0).Rows(0).LastCell.ContentRange.Start.ToInt()
Dim range3 As DocumentRange = document.CreateRange(startPos3, 100)
Dim range4 As DocumentRange = document.CreateRange(720, 100)
document.Selections.Add(New List(Of DocumentRange)() From {range1, range2, range3, range4})

Inheritance

Object
SelectionCollection
See Also