ITextSelection::MoveUp method (tom.h)

Mimics the functionality of the Up Arrow and Page Up keys.

Syntax

HRESULT MoveUp(
  long Unit,
  long Count,
  long Extend,
  long *pDelta
);

Parameters

Unit

Type: long

Unit to use in the operation. It can be one of the following.

Value Corresponding key combination Meaning
tomLine Up Arrow Moves up one line. This is the default.
tomParagraph Ctrl+Up Arrow Moves up one paragraph.
tomScreen Page Up Moves up one screen.
tomWindow Ctrl+Page Up Moves to first character in window.

Count

Type: long

Number of Units to move past. The default value is 1.

Extend

Type: long

Flag that indicates how to change the selection. If Extend is zero (or tomMove), the method collapses the selection to an insertion point and then moves. If Extend is 1 (or tomExtend), the method moves the active end and leaves the other end alone. The default value is zero. A nonzero Extend value corresponds to the Shift key being pressed in addition to the key combination described in Unit.

pDelta

Type: long*

The actual count of units the insertion point or active end is moved down. This parameter can be null. Collapsing the selection counts as one unit.

Return value

Type: HRESULT

The method returns an HRESULT value. If the method succeeds, it returns S_OK. If the method fails, it returns one of the following error codes. For more information about COM error codes, see Error Handling in COM.

Return code Description
E_INVALIDARG
Unit is not valid.
S_FALSE
Failure for some other reason.

Remarks

The MoveUp and MoveDown methods are similar to the MoveLeft and MoveRight methods, except that they reflect the behavior of the Up Arrow, Down Arrow, Page Up, and Page Down keys on the cursor-keypad.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header tom.h
DLL Msftedit.dll

See also

Conceptual

ITextSelection

MoveDown

MoveLeft

MoveRight

Reference

Text Object Model