Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.47 KB

itextrange_setindex_1585854244.md

File metadata and controls

31 lines (22 loc) · 1.47 KB
-api-id -api-type
M:Microsoft.UI.Text.ITextRange.SetIndex(Microsoft.UI.Text.TextRangeUnit,System.Int32,System.Boolean)
winrt method

Microsoft.UI.Text.ITextRange.SetIndex

-description

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

-parameters

-param unit

The unit used to move the text range.

-param index

The index of the specified unit. The text range is relocated to the unit that has this index. If unit is positive, the numbering of units begins at the start of the story and proceeds forward. If negative, the numbering begins at the end of the story and proceeds backward. The start of the story corresponds to index = 1 for all existing units, and the last unit in the story corresponds to index = – 1.

-param extend

Indicates how to change the text range. True extends the text range to include the unit by moving only the end position of the text range. False collapses the text range to an insertion point and then moves the insertion point. The default value is false.

-remarks

This method allows an app to work with line-oriented text, such as source code listings, in a convenient way. For example, ITextRange.SetIndex(Line, 10, 0) converts the text range to an insertion point at the start of the tenth line.

-examples

-see-also

ITextRange.GetIndex