JavaScript Editor js editor     Web development 

Main Page

Places a data format in the OLE DataObject object. Available at run time only.

You can call the SetFormat method in the OLEStartDrag and OLESetData events.

oDataObject.SetFormat(nFormat | cFormat)


nFormat| cFormat

Specifies the format of the data placed on the DataObject object. You can also create your own format by specifying a unique character string for cFormat. The following table lists values for some common data formats with a description of each format.

Data format* nFormat| cFormat Description



Text format.



Text format containing characters in the OEM character set.



Unicode text format.

Available only for versions of Visual FoxPro running on Windows NT 4.0 or later.



A handle that identifies a list of files, such as a set of files dragged from the Windows Explorer.


"OLE Variant Array"

An array. Multiple values can be transferred in a single drag-and-drop operation with this format.

For example, this format can be used to drag a set of items in a list box to another list box.


"OLE Variant"

A variant.

All data types in Visual FoxPro are represented as variants. This format can be used to drag and drop Visual FoxPro data without losing the data type.


"VFP Source Object"

A reference to the Visual FoxPro drag source object.

* Defined in FOXPRO.H.


Applies To: DataObject Object

You can place a data format in the DataObject object before placing the corresponding data on the DataObject object. If you place a data format in the DataObject object without corresponding data and invoke the GetData method in the OLEDragDrop event, the OLESetData event is executed for the drag source. The drag source can then place the data on the DataObject with the SetData method in the OLESetData event.

When using data formats that are not natively supported by Visual FoxPro or when using a large number of formats, you can improve OLE drag-and-drop performance by placing only the data formats on the DataObject object when a large amount of data is placed on the DataObject object.

See Also

JavaScript Editor js editor     Web development