Export (0) Print
Expand All

dropEffect property

[This documentation is preliminary and is subject to change.]

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

Syntax

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

Property values

Type: BSTR

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.

Remarks

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

Reference
IHTMLDataTransfer::clearData
IHTMLDataTransfer::effectAllowed
IHTMLDataTransfer::getData
IHTMLDataTransfer::setData
Conceptual
About DHTML Data Transfer

 

 

Build date: 6/6/2012

Community Additions

Show:
© 2014 Microsoft