ITextSelection::MoveUp method

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.

ValueCorresponding key combinationMeaning
tomLineUp ArrowMoves up one line. This is the default.
tomParagraphCtrl+Up ArrowMoves up one paragraph.
tomScreenPage UpMoves up one screen.
tomWindowCtrl+Page UpMoves 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 codeDescription
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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

Reference
ITextSelection
MoveDown
MoveLeft
MoveRight
Conceptual
Text Object Model

 

 

Community Additions

ADD
Show:
© 2014 Microsoft