Occurs when data is dropped on a drop target and the drop target's OLEDropMode property is set to 1 вЂ“ Enabled.
PROCEDURE Object.OLEDragDrop LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord
- 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.
A value passed to the OLECompleteDrag event, indicating the action performed when 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. Within the OLEDragDrop event you can change the value of nEffect , which is passed to the OLECompleteDrag event. If you change the value of nEffect, be sure to include NODEFAULT in the event code to prevent the default behavior. The following table lists the values for nEffect that you can pass to the OLECompleteDrag event with a description of each action.
nEffect Foxpro.h constant Description
Drop target did not accept the data or the drop operation was canceled.
Data was copied from the drag source to the drop target.
Data was moved from the drag source to the drop target.
Data was linked from the drag source to the drop target.
- Contains a number that specifies which mouse button was released to drop the data on the target: 1 (left), 2 (right), or 4 (middle).
Contains a number specifying the state of modifier keys when the mouse was released to drop the data on the 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.
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.
nShift Modifier key
- nXCoord, nYCoord
- Contains the horizontal (nXCoord) and vertical (nYCoord) position of the mouse pointer within the Form when the mouse button was released to drop the data on the 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.
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
OLEDragDrop 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.
If you perform your own drop processing in the OleDragDrop event, include NODEFAULT to prevent the default drop from occuring. In this case, you must then set the resulting nEffect value.