Aracılığıyla paylaş


Run-Time OLE Drag-and-Drop Support

OLE drag-and-drop support is available at run time for Visual FoxPro controls and the text editor. The controls and the text editor support OLE drag-and-drop interactively at run time, and the controls provide programmatic support at run time. The DataObject object provides programmatic OLE drag-and-drop support for the controls.

Two modes of OLE drag-and-drop are available for Visual FoxPro controls: intrinsic mode and manual mode. In intrinsic mode, Visual FoxPro intrinsically handles an OLE drag-and-drop operation. In manual mode, OLE drag-and-drop operations are handled programmatically. The events that occur are determined by the OLE drag-and-drop mode. For more information, see the section, "Intrinsic and Manual OLE drag-and-drop Modes."

Drag and Drop in Previous Versions of Visual FoxPro

Previous versions of Visual FoxPro supported programmatic drag-and-drop for controls, making it possible for you to move controls on a form. This form of drag and drop is still supported. If you use the default settings for the OLEDragMode and OLEDropMode properties, your existing applications will run as before without any changes.

The DataObject Object

The DataObject object is a container for data being transferred from an OLE drag source to an OLE drop target, and exists only for the duration of an OLE drag-and-drop operation. The DataObject object cannot be created programmatically and references to it become invalid once the OLE drag-and-drop operation is completed. The DataObject is passed as the oDataObject parameter in the OLEStartDrag, OLEDragOver, OLEDragDrop, and OLESetData events.

The DataObject can store multiple sets of data, each in a different format. The existence of a specific format in the DataObject can be determined with the GetFormat method. See the GetFormat Method for a listing of the formats supported by the DataObject.

DataObject Object Methods

The DataObject object has methods that make it possible for you to programmatically manipulate the data being dragged and dropped. The following table lists the methods available at run time for the DataObject.

Method

Description

ClearData

Clears all data and data formats from the OLE drag-and-drop DataObject object.

GetData

Retrieves data from the OLE drag-and-drop DataObject object.

GetFormat

Determines whether data in a specified format is available on the OLE drag-and-drop DataObject.

SetData

Places data and its format on the OLE drag-and-drop DataObject.

SetFormat

Places a data format without data on the OLE drag-and-drop DataObject.

See Also

Reference

Design-Time OLE Drag-and-Drop Support

Other Resources

Interoperability and the Internet