Windows Dev Center

ITextRange.MoveStart method

Moves the start position of a text range.

Syntax


int MoveStart(
  TextRangeUnit unit, 
  int count
)

Parameters

unit

Type: TextRangeUnit

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

count

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

The number of units to move the start position of the text range. The default value is 1. If count is greater than zero, the start position of the text range moves forward, toward the end of the story. If count is less than zero, the start position of the text range moves backward, toward the beginning of the story. If count is zero, the start position doesn't move.

Return value

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

The actual number of units that the start position moved. The pointer can be NULL.

Remarks

If you move the start position of the text range so that it follows the original end position, this method sets the end position to be equal to the new start position; that is, the text range becomes a degenerate range (insertion point).

This method moves the start position in a logical direction rather than a physical direction. That is, movement is toward the end or start of a story. Depending on the language, moving the start position toward the end of the story could result in the start position moving either left or right.

For more information, see the discussion in ITextRange and the Remarks section of ITextRange.Move.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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.Move
ITextRange.MoveEnd

 

 

Show:
© 2015 Microsoft