Aracılığıyla paylaş


OLEDragOver Event

Occurs when data is dragged over a drop target and the drop target's OLEDropMode property is set to 1 – Enabled.

PROCEDURE Object.OLEDragOver
LPARAMETERS oDataObject, nEffect, nButton,
  nShift,   nXCoord, nYCoord, nState

Return Value

  • oDataObject
    An object reference to OLE drag-and-drop DataObject, used with the GetData and GetFormat methods to return data and data formats in the DataObject.

  • nEffect
    A value passed to the OLEGiveFeedback event, indicating the action performed if data is dropped on the drop target. nEffect is initially a value that indicates the OLE drag-and-drop operations supported by the drag source. The following table lists the values for nEffect with a description of each action.

    nEffect

    Foxpro.h constant

    Description

    0

    DROPEFFECT_NONE

    Drop target doesn't accept the data or the drop operation is canceled.

    1

    DROPEFFECT_COPY

    Data is copied from the drag source to the drop target.

    2

    DROPEFFECT_MOVE

    Data is moved from the drag source to the drop target.

    4

    DROPEFFECT_LINK

    Data is linked from the drag source to the drop target.

  • nButton
    Contains a number that specifies which mouse button is pressed when data is dragged over a drop target: 1 (left), 2 (right), or 4 (middle).

  • nShift
    Contains a number specifying the state of modifier keys when data is dragged over a drop target. The valid modifier keys are the SHIFT, CTRL, and ALT keys. The values returned in nShift for individual modifier keys are listed in the following table.

    nShift

    Modifier key

    1

    SHIFT

    2

    CTRL

    4

    ALT

    If more than one modifier key is held down when the mouse is pressed, the nShift argument contains the sum of the values for the modifier keys. For example, if the user holds CTRL while releasing the mouse button, the nShift argument contains 2. But, if the user holds CTRL+ALT while releasing the mouse button, the nShift argument contains 6.

  • 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 specifying the direction in which the data is dragged – into the control or object, within the control or object, or out of the control or object. The values for nState are listed in the following table.

    nState

    Description

    0

    Data is dragged into the control or object. The OLEDropEffects and OLEDropHasData properties can be set when nState is zero.

    1

    Data is dragged out of the control or object.

    2

    Data is dragged within the control or object.

Remarks

Applies To: CheckBox | ComboBox | CommandButton | CommandGroup | Container Object | Control Object | EditBox | Form | Grid | Image | Label | Line | ListBox | OptionButton | OptionGroup | Page | PageFrame | ProjectHook Object | Shape | Spinner | TextBox | ToolBar

OLEDragOver is a drop target event that only occurs when the OLEDropMode property for the control or object is set to 1 – Enabled. This event does not occur if the OLEDropMode property is set to 0 – Disabled or 2 – Pass to Container.

Note that you should avoid creating wait states in the OLEDragOver event with commands and functions such as WAIT WINDOW and MESSAGEBOX( ).

See Also

Reference

OLE Drag-and-Drop

OLEGiveFeedback Event

OLEDropEffects Property

OLEDropHasData Property

OLEDropMode Property

Other Resources

Events (Visual FoxPro)