GetSelection Method
Collapse the table of content
Expand the table of content

ITextProvider.GetSelection Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Retrieves a collection of disjoint text ranges that are associated with the current text selection or selections.

Namespace:  System.Windows.Automation.Provider
Assembly:  System.Windows (in System.Windows.dll)

'Declaration
Function GetSelection As ITextRangeProvider()

Return Value

Type: System.Windows.Automation.Provider.ITextRangeProvider ()
A collection of disjoint text ranges.

ExceptionCondition
InvalidOperationException

If the UI Automation provider does not support text selection.

For UI Automation providers that support text selection, the provider should implement this method and also return a SupportedTextSelection value.

If no text is selected, GetSelection returns the degenerate text range (empty range) at the position of the system cursor (the text insertion point).

If the system cursor is not present, GetSelection may return Nothing.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft