EndKey method
Collapse the table of content
Expand the table of content

ITextSelection.EndKey method

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.

Syntax


int EndKey(
  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 end of the last line in the selection. This is the default.

Story

Moves the insertion point or the active end to the end of the last 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 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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

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

ITextSelection
ITextSelection.HomeKey

 

 

Show:
© 2017 Microsoft