OLEDragMode, OLEDropMode
These two properties determine whether, and in what way, a control plays OLE drag and drop.
Usage |
nODragMode = oObject.OLEDragMode oObject.OLEDragMode = nODragMode nODropMode = oObject.OLEDropMode oObject.OLEDropMode = nODropMode |
Parameter |
Value |
Meaning |
nODragMode |
0 |
Default. Don't allow data from this object to be dragged. |
1 |
Allow data from this object to be dragged. |
|
nODropMode |
0 |
Default. Don't allow data to be dropped on this object. |
1 |
Allow data to be dropped on this object. |
|
2 |
If data is dropped on this object, pass it to the object's container. |
An object can use either VFP's native drag or OLE drag, but not both. If you set DragMode to 1 (Automatic), the value of OLEDragMode is ignored, and the object uses native dragging. However, an object can accept both native drops and OLE drops. Microsoft advises not mixing the two modes in one application, and we tend to agree that it could get confusing for the operator. |
Example |
* You'll usually set these properties at design-time. * But you might let a user decide whether to have drag * and drop enabled, based on an application setting. * So you might have code in the object's Init. This.OLEDragMode = oApp.lDragAndDrop |
See Also |
DragDrop, DragMode, GetData, GetFormat, OLE drag and drop, OLEDrag, OLEDragDrop, OLEDropEffects, OLEDropHasData |