ITextRange.StartOf method

Applies to Windows and Windows Phone

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.

Syntax


int StartOf(
  TextRangeUnit unit, 
  bool extend
)

Parameters

unit

Type: TextRangeUnit

The unit by which to move the start position of the text range. The default value is Word.

extend

Type: System.Boolean [.NET] | Platform::Boolean [C++]

True extends the text range by moving just the start position of the range to the start of the specified unit. False moves both ends of the text range to the start of the specified unit. The default value is false.

Return value

Type: System.Int32 [.NET] | int32 [C++]

The number of characters the insertion point or start position is moved. Note that this value is always less than or equal to zero, since the motion is always toward the beginning of the story.

Remarks

If the text range is an insertion point on a boundary between units, this method does not change the start position.

The start position does not change if unit is set to Character.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Text
Windows::UI::Text [C++]

Metadata

Windows.winmd

See also

ITextRange
ITextRange.EndOf

 

 

Show:
© 2014 Microsoft