Delen via


ITextSelection.EndKey(TextRangeUnit, Boolean) Method

Definition

Moves the insertion point or the active end of the text selection to the end of the specified unit, mimicking the functionality of the End key.

public:
 int EndKey(TextRangeUnit unit, bool extend);
int EndKey(TextRangeUnit const& unit, bool const& extend);
public int EndKey(TextRangeUnit unit, bool extend);
function endKey(unit, extend)
Public Function EndKey (unit As TextRangeUnit, extend As Boolean) As Integer

Parameters

unit
TextRangeUnit

The units by which to move the insertion point or active end. The following values are valid.

extend
Boolean

bool

Indicates how to change the selection. True extends the selection by moving only the active end. False collapses the selection to an insertion point and then moves the insertion point. The default value is false.

Returns

Int32

int

The number of units that the insertion point or the active end is moved.

Remarks

The EndKey method is a logical method rather than a directional method and so is dependent on the language that is involved. For example, in Arabic text, EndKey moves to the left end of a line, whereas in English text, it moves to the right. Thus EndKey is different from the ITextSelection.MoveRight or ITextSelection.MoveLeft methods. Also, note that the EndKey method is quite different from the End property, which is the character position at the end of the selection. EndKey also differs from the ITextRange.EndOf method in that it extends from the active end, whereas EndOf extends from End.

Applies to

See also