Share via


ITextSelection.HomeKey(TextRangeUnit, Boolean) Method

Definition

Moves the insertion point or the active end of the text selection to the home position, mimicking the functionality of the Home key.

public:
 int HomeKey(TextRangeUnit unit, bool extend);
int HomeKey(TextRangeUnit const& unit, bool const& extend);
public int HomeKey(TextRangeUnit unit, bool extend);
function homeKey(unit, extend)
Public Function HomeKey (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 HomeKey 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, HomeKey moves to the right end of a line, whereas in English text, it moves to the left. Thus HomeKey is different from the ITextSelection.MoveRight or ITextSelection.MoveLeft methods. HomeKey also differs from the ITextRange.StartOf method in that it extends from the active end, whereas StartOf extends from the start position.

Applies to

See also