ITextRange.StartPosition ITextRange.StartPosition ITextRange.StartPosition ITextRange.StartPosition Property


Gets or sets the start position of the text range.

public : int StartPosition { get; set; }
int32_t StartPosition();

void StartPosition(int32_t startposition);
public int StartPosition { get; set; }
Public ReadWrite Property StartPosition As int

Property Value

int int

The character position to set as the start position of the text range.


If the start position is greater than the end position, this method sets the end position to be equal to the start position, resulting in a degenerate range (insertion point).

If this text range represents the active selection, the start position becomes the active end of the selection and is scrolled into view if the display is not frozen.

The following example shows how to convert a nondegenerate range into a degenerate range. range.End = range.Start

Similarly, the following example converts the text range into a degenerate range at the end of the range. range.Start = range.End

The following example adds 1 to end of the text range, if the range is not at the end of the story. range.End = range.End + 1

The preceding example also makes the end of the text range the active end, and can turn a degenerate range into a nondegenerate one.