ITextRangeProvider.GetText Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Retrieves the plain text of the range.

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

Syntax

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

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.

Exceptions

Exception Condition
ArgumentOutOfRangeException

maxLength is less than -1.

Remarks

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.

Version Information

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.