GetText Method

ITextRangeProvider.GetText 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 the plain text of the range.

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

'Declaration
Function GetText ( _
	maxLength As Integer _
) As String

Parameters

maxLength
Type: System.Int32
The maximum length of the string to return. Use -1 to specify an unlimited length.

Return Value

Type: System.String
The plain text of the text range, which might represent a portion of the full string truncated at the specified maxLength.

ExceptionCondition
ArgumentOutOfRangeException

maxLength is less than -1.

GetText considersboth hidden and visible text.

If maxLength is greater than the length of the text span of the caller, the returned string is the plain text of the text range.

GetText is unaffected by the order of endpoints in the text flow; it always returns the text from the Start through the End endpoints of the text range, in the logical order of the text flow.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft