ITextRangeProvider.GetText Method

Retrieves the plain text of the range.

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

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.

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.

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

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

Community Additions

ADD
Show: