Sets or gets the type of drag-and-drop operation and the type of cursor to display.
HRESULT IHTMLDataTransfer::get_dropEffect(BSTR *p);HRESULT IHTMLDataTransfer::put_dropEffect(BSTR v);
- Pointer to a variable of type BSTR that receives one of the values listed in Possible Values.
- BSTR that specifies one of the values listed in Possible Values.
copy Copy cursor is displayed. link Link cursor is displayed. move Move cursor is displayed. none Default. No cursor is specified. Instead, the no-drop cursor is displayed.
Returns S_OK if successful, or an error value otherwise.
The IHTMLDataTransfer::dropEffect property must be used with the IHTMLDataTransfer::effectAllowed property. These properties are set on the source object of a drag-and-drop operation. The IHTMLDataTransfer::effectAllowed property determines which drag-and-drop operations are available from the source object. The IHTMLDataTransfer::dropEffect property determines which drag-and-drop operations are allowed on the target object. For example, the source object might set the IHTMLDataTransfer::effectAllowed property to
alldrag-and-drop operations, while the target object specifies that the IHTMLDataTransfer::dropEffect allows only
The recommended technique for dropping text is to set the IHTMLDataTransfer::dropEffect in the target object's event handler function for the following events: ondragenter, ondragover, and ondrop. The IHTMLDataTransfer::effectAllowed property must be set in one of the source object's drag-and-drop event handlers, such as the ondragstart event.
The target object of a drag-and-drop operation can set the IHTMLDataTransfer::dropEffect during the following events: ondragenter, ondragover, and ondrop. To display the cursor until the final drop, the default action of the following events must be canceled: ondragenter, ondragover, and ondrop: and the IHTMLDataTransfer::dropEffect must be set. Otherwise, the copy cursor, move cursor, or link cursor set by this property displays only until the first valid drop target is intersected, at which point the cursor is replaced by the drop/no-drop cursor for the rest of the drag operation.
Windows Internet Explorer delivers default drag-and-drop functionality for the following objects: a, img, textArea, and input type=text. When one of these objects is the source element, the default drop effect cannot be overridden by setting the IHTMLDataTransfer::dropEffect property of the target element. Instead, the default behavior of the source object must be canceled.