Occurs when you select and move an item up or down in a list box using the mouse, keyboard, or programmatically with the MoveItem method.
PROCEDURE OnMoveItem LPARAMETERS nSource, nShift, nCurrentIndex, nMoveBy
Contains a number that specifies how the event is triggered.
Left mouse button
Right mouse button
Middle mouse button
Programmatically triggered by the MoveItem method
Contains a number that specifies which modifier keys, SHIFT, CTRL, and ALT, are also pressed when the mouse button is pressed. The following table lists the values returned by nShift for individual modifier keys.
If more than one modifier key is held down when the mouse button is pressed, the nShift argument contains the sum of the values for the modifier keys. For example, if the user holds CTRL while pressing the mouse button, the nShift argument contains a value of 2. However, if the user holds down CTRL+ALT while pressing the mouse button, the nShift argument contains a value of 6.
- Contains the current index of the item being moved.
- Indicates how many positions the item is being moved. A positive value indicates downward movement. A negative number indicates upward movement. The nMoveBy parameter always has a value of 1 or -1 if the user is moving a list item using the keyboard. It usually has a value of 1 or -1 if the user is moving a list item using the mouse. However, nMoveBy indicates the position to which the item is moved if the user drags the mouse outside the bounds of the list box and then back to a remote position.
Applies To: ListBox Control
OnMoveItem occurs after selecting and moving an item by pressing CTRL+UP ARROW, CTRL+DOWN ARROW or by using the mouse, or when calling the MoveItem method programmatically. OnMoveItem occurs after every subsequent move but before the list box displays the item movement. However, OnMoveItem occurs only once when calling the MoveItem method programmatically.
|You can move ListBox control items only if the list box's RecordSourceType property is set to 0 (None) or 1 (Value).|
To prevent movement from occurring, return False (.F.) from the code in the OnMoveItem event.