ITextSelection.HomeKey method

Applies to Windows and Windows Phone

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

Syntax


int HomeKey(
  TextRangeUnit unit, 
  bool extend
)

Parameters

unit

Type: TextRangeUnit

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

ValueMeaning
Line

Moves the insertion point or the active end to the beginning of the first line in the selection. This is the default.

Story

Moves either the insertion point or the active end to the beginning of the first line in the story.

 

extend

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

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.

Return value

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

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.

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

ITextSelection
ITextSelection.EndKey

 

 

Show:
© 2014 Microsoft