Collapse the table of content
Expand the table of content

dropEffect property

Sets or gets the type of drag-and-drop operation and the type of cursor to display.


HRESULT value = object.put_dropEffect( v);HRESULT value = object.get_dropEffect(* p);

Property values

Type: BSTR


Copy cursor is displayed.


Link cursor is displayed.


Move cursor is displayed.


Default. No cursor is specified. Instead, the no-drop cursor is displayed.


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 all drag-and-drop operations, while the target object specifies that the IHTMLDataTransfer::dropEffect allows only copy operations.

The recommended technique for dropping text is to set the IHTMLDataTransfer::dropEffect in the target object's event handler function for the following events: HTMLFrameSiteEvents::ondragenter, HTMLFrameSiteEvents::ondragover, and HTMLFrameSiteEvents::ondrop. The IHTMLDataTransfer::effectAllowed property must be set in one of the source object's drag-and-drop event handlers, such as the HTMLFrameSiteEvents::ondragstart event.

The target object of a drag-and-drop operation can set the IHTMLDataTransfer::dropEffect during the following events: HTMLFrameSiteEvents::ondragenter, HTMLFrameSiteEvents::ondragover, and HTMLFrameSiteEvents::ondrop. To display the cursor until the final drop, the default action of the following events must be canceled: HTMLFrameSiteEvents::ondragenter, HTMLFrameSiteEvents::ondragover, and HTMLFrameSiteEvents::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.

See also

About DHTML Data Transfer



Community Additions

© 2015 Microsoft