DragOver Event

Occurs when a control is being dragged over a target object.

PROCEDURE Object.DragOver
LPARAMETERS oSource, nXCoord, nYCoord, nState

Parameters

You must include an LPARAMETERS or PARAMETERS statement in the event procedure and specify a name for each parameter; otherwise an error occurs. Visual FoxPro passes the DragOver event parameters in the following order:

oSource

Contains a reference to the control being dragged. You can refer to properties and methods of the control with this parameter.

nXCoord, nYCoord

Contains the horizontal (nXCoord) and vertical (nYCoord) position of the mouse pointer within the Form when data is dragged over a drop target. These coordinates are expressed in terms of the Form's coordinate system in the unit of measurement specified by the ScaleMode property of the Form. '

nState

Contains a number that represents the transition state of the control being dragged in relation to the target object:

Setting Description

0

Enter. The control is being dragged within the range of a target.

1

Leave. The control is being dragged out of the range of a target.

2

Over. The control has moved from one position in the target to another.

Use nStateto determine actions at key transition points. For example, you can highlight a possible target on nState= 0 (Enter) and restore the object's appearance on nState= 1 (Leave).

When an object receives a DragOver event with nState = 0 (Enter):

  • A DragDrop event is triggered if the source control is dropped on a target object.

  • Another DragOver event is triggered with nState = 1 (Leave) if the source control is not dropped on a valid target.

Expand imageRemarks

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic