ITextRange ITextRange ITextRange ITextRange Interface

Definition

Represents a span of continuous text in a document, and provides powerful editing and data-binding properties and methods that allow an app to select, examine, and change document text.

public : interface ITextRange
struct winrt::Windows::UI::Text::ITextRange
public interface ITextRange
Public Interface ITextRange
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

Character Character Character Character

Gets or sets the first character of the text range; that is, the character associated with the StartPosition property.

CharacterFormat CharacterFormat CharacterFormat CharacterFormat

Gets or sets the character formatting attributes of the text range.

EndPosition EndPosition EndPosition EndPosition

Gets or sets the end character position of the text range.

FormattedText FormattedText FormattedText FormattedText

Gets or sets an ITextRange object with the formatted text of the specified range.

Gravity Gravity Gravity Gravity

Gets or sets the gravity of the text range.

Length Length Length Length

Gets the count of characters in the text range.

Link Link Link Link

Gets or sets the URL text associated with a text range.

ParagraphFormat ParagraphFormat ParagraphFormat ParagraphFormat

Gets or sets the paragraph formatting attributes of the text range.

StartPosition StartPosition StartPosition StartPosition

Gets or sets the start position of the text range.

StoryLength StoryLength StoryLength StoryLength

Gets the count of characters in the story of the text range.

Text Text Text Text

Gets or sets the plain text of the text range.

Methods

CanPaste(Int32) CanPaste(Int32) CanPaste(Int32) CanPaste(Int32)

Determines whether the Clipboard contains content that can be pasted, using a specified format, into the current text range.

ChangeCase(LetterCase) ChangeCase(LetterCase) ChangeCase(LetterCase) ChangeCase(LetterCase)

Changes the case of letters in a text range.

Collapse(Boolean) Collapse(Boolean) Collapse(Boolean) Collapse(Boolean)

Collapses the text range into a degenerate point at either the beginning or end of the range.

Copy() Copy() Copy() Copy()

Copies the text of the text range to the Clipboard.

Cut() Cut() Cut() Cut()

Moves the text of the text range to the Clipboard.

Delete(TextRangeUnit, Int32) Delete(TextRangeUnit, Int32) Delete(TextRangeUnit, Int32) Delete(TextRangeUnit, Int32)

Deletes text from the text range.

EndOf(TextRangeUnit, Boolean) EndOf(TextRangeUnit, Boolean) EndOf(TextRangeUnit, Boolean) EndOf(TextRangeUnit, Boolean)

Moves or extends the text range to the end of the nearest specified text unit. The text range is moved or extended forward in the document.

Expand(TextRangeUnit) Expand(TextRangeUnit) Expand(TextRangeUnit) Expand(TextRangeUnit)

Expands a text range to completely contain any partial text units.

FindText(String, Int32, FindOptions) FindText(String, Int32, FindOptions) FindText(String, Int32, FindOptions) FindText(String, Int32, FindOptions)

Searches for a particular text string in a range and, if found, selects the string.

GetCharacterUtf32(UInt32, Int32) GetCharacterUtf32(UInt32, Int32) GetCharacterUtf32(UInt32, Int32) GetCharacterUtf32(UInt32, Int32)

Retrieves the Unicode Transformation Format (UTF)-32 character code of the character at the specified offset from the end of the text range.

GetClone() GetClone() GetClone() GetClone()

Creates a new object that is identical to this text range object.

GetIndex(TextRangeUnit) GetIndex(TextRangeUnit) GetIndex(TextRangeUnit) GetIndex(TextRangeUnit)

Retrieves the story index of the text unit (word, line, sentence, paragraph, and so on) at the starting character position of the text range.

GetPoint(HorizontalCharacterAlignment, VerticalCharacterAlignment, PointOptions, Point) GetPoint(HorizontalCharacterAlignment, VerticalCharacterAlignment, PointOptions, Point) GetPoint(HorizontalCharacterAlignment, VerticalCharacterAlignment, PointOptions, Point) GetPoint(HorizontalCharacterAlignment, VerticalCharacterAlignment, PointOptions, Point)

Retrieves the screen coordinates of a particular location in the text range.

GetRect(PointOptions, Rect, Int32) GetRect(PointOptions, Rect, Int32) GetRect(PointOptions, Rect, Int32) GetRect(PointOptions, Rect, Int32)

Retrieves the bounding rectangle that encompasses the text range on the screen.

GetText(TextGetOptions, String) GetText(TextGetOptions, String) GetText(TextGetOptions, String) GetText(TextGetOptions, String)

Retrieves the text in a text range according to the specified conversion flags.

GetTextViaStream(TextGetOptions, IRandomAccessStream) GetTextViaStream(TextGetOptions, IRandomAccessStream) GetTextViaStream(TextGetOptions, IRandomAccessStream) GetTextViaStream(TextGetOptions, IRandomAccessStream)

Retrieves the text in the text range according to the specified conversion flags, as a random access stream.

InRange(ITextRange) InRange(ITextRange) InRange(ITextRange) InRange(ITextRange)

Determines whether this range is in or at the same text as a specified range.

InsertImage(Int32, Int32, Int32, VerticalCharacterAlignment, String, IRandomAccessStream) InsertImage(Int32, Int32, Int32, VerticalCharacterAlignment, String, IRandomAccessStream) InsertImage(Int32, Int32, Int32, VerticalCharacterAlignment, String, IRandomAccessStream) InsertImage(Int32, Int32, Int32, VerticalCharacterAlignment, String, IRandomAccessStream)

Inserts an image into this range.

InStory(ITextRange) InStory(ITextRange) InStory(ITextRange) InStory(ITextRange)

Determines whether this range's story is the same as a specified range's story.

IsEqual(ITextRange) IsEqual(ITextRange) IsEqual(ITextRange) IsEqual(ITextRange)

Determines whether this range has the same character positions and story as those of a specified range.

MatchSelection() MatchSelection() MatchSelection() MatchSelection()

Sets the start and end positions of this range to match the active selection.

Move(TextRangeUnit, Int32) Move(TextRangeUnit, Int32) Move(TextRangeUnit, Int32) Move(TextRangeUnit, Int32)

Moves the insertion point forward or backward by the specified number of units. If the text range is nondegenerate, it is collapsed to an insertion point at the start or end position of the text range, depending on count, and then is moved.

MoveEnd(TextRangeUnit, Int32) MoveEnd(TextRangeUnit, Int32) MoveEnd(TextRangeUnit, Int32) MoveEnd(TextRangeUnit, Int32)

Moves the end position of the text range.

MoveStart(TextRangeUnit, Int32) MoveStart(TextRangeUnit, Int32) MoveStart(TextRangeUnit, Int32) MoveStart(TextRangeUnit, Int32)

Moves the start position of a text range.

Paste(Int32) Paste(Int32) Paste(Int32) Paste(Int32)

Pastes text from the Clipboard into the text range.

ScrollIntoView(PointOptions) ScrollIntoView(PointOptions) ScrollIntoView(PointOptions) ScrollIntoView(PointOptions)

Scrolls this text range into view.

SetIndex(TextRangeUnit, Int32, Boolean) SetIndex(TextRangeUnit, Int32, Boolean) SetIndex(TextRangeUnit, Int32, Boolean) SetIndex(TextRangeUnit, Int32, Boolean)

Moves the text range to the specified unit of the story.

SetPoint(Point, PointOptions, Boolean) SetPoint(Point, PointOptions, Boolean) SetPoint(Point, PointOptions, Boolean) SetPoint(Point, PointOptions, Boolean)

Changes the text range based on the specified point.

SetRange(Int32, Int32) SetRange(Int32, Int32) SetRange(Int32, Int32) SetRange(Int32, Int32)

Sets the endpoints of the text range to the specified values.

SetText(TextSetOptions, String) SetText(TextSetOptions, String) SetText(TextSetOptions, String) SetText(TextSetOptions, String)

Replaces the text in the text range.

SetTextViaStream(TextSetOptions, IRandomAccessStream) SetTextViaStream(TextSetOptions, IRandomAccessStream) SetTextViaStream(TextSetOptions, IRandomAccessStream) SetTextViaStream(TextSetOptions, IRandomAccessStream)

Sets the text in the text range based on the contents of a random access stream.

StartOf(TextRangeUnit, Boolean) StartOf(TextRangeUnit, Boolean) StartOf(TextRangeUnit, Boolean) StartOf(TextRangeUnit, Boolean)

Moves or extends the text range to the start of the nearest specified text unit. The text range is moved or extended backward in the document.