Platform SDK: Windows User Interface

ITextSelection::MoveDown

The ITextSelection::MoveDown method mimics the functionality of the UI DOWN ARROW and PAGE DOWN keys.

STDMETHODIMP ITextSelection::MoveDown(
  long Unit,
  long Count,
  long Extend,
  long *pDelta
);

Parameters

Unit
Unit to use in the operation. It can be one of the following.
Value Corresponding key combination Meaning
tomLine DOWN ARROW (¯) Moves down one line. This is the default.
tomParagraph CTRL+DOWN ARROW (¯) Moves down one paragraph.
tomScreen PAGE DOWN Moves down one screen.
tomWindow CTRL+PAGE DOWN Moves to last character in window.

Count
Number of Units to move past. The default value is 1.
Extend
Flag that indicates how to change the selection. If Extend = zero (or tomMove), the method collapses the selection to an insertion point and then moves. If Extend = 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
Pointer to a variable that receives the actual count of Units moved. The method returns *pDelta = actual count of units the insertion point or active end is moved down. This parameter can be null. Note: Collapsing the selection counts as one unit.

Return Values

The method returns an HRESULT. 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.

Value Meaning
E_INVALIDARG Unit is not valid.
S_FALSE Failure for some other reason.

Remarks

The ITextSelection::MoveUp and ITextSelection::MoveDown methods are similar to the ITextSelection::MoveLeft and ITextSelection::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

  Version: Requires Rich Edit 2.0 or later.
  Header: Declared in Tom.h.

See Also

Text Object Model Overview, Text Object Model Interfaces, ITextSelection, ITextSelection::MoveLeft, ITextSelection::MoveRight, ITextSelection::MoveUp