OLEDragPicture, OLEGiveFeedback
This property and method give you control over what the user sees during OLE drag and drop. OLEDragPicture controls the image of what's being dragged. OLEGiveFeedback is a method that lets you change the cursor used for the drag, as well as take other actions if you want.
Usage |
oObject.OLEDragPicture = cPictureFile cPictureFile = oObject.OLEDragPicture PROCEDURE oObject.OLEGiveFeedback LPARAMETERS nEffect, eMouseCursor |
Parameter |
Value |
Meaning |
cPictureFile |
Filename |
The name of the file containing the graphic to show being dragged. |
nEffect |
Numeric |
The reaction of the object currently under the mouse to OLE drag and drop. Indicates whether a drop is welcome and, if it is, what the result is. |
eMouseCursor |
0 |
Use the cursor specified by the drop target for nEffect. We have no control over what that cursor is, but most objects seem to make good choices. |
1-16 |
Specifies which of the built-in cursor graphics is currently being used or should be used. |
|
Numeric other than 0-16 |
Only the regular mouse pointer appears. |
|
Filename |
The name of a graphic file containing the mouse pointer currently in use or the one that should be used. |
OLEGiveFeedback is a drag source event, so it fires even when you're dragging over objects outside VFP. That's right, you can drag data from VFP into other apps and still control the mouse cursor. Giving control to the drag source is generally an improvement over VFP's native drag and drop, where the target can tell the source what DragIcon to use, but the source can't do anything about it. |
Example |
* Specify a cursor based on the potential drop action * Most drop targets will provide the usual cursors anyway, * so we'll do strange things here. LPARAMETERS nEffect, eMouseCursor DO CASE CASE nEffect = 0 && Can't drop here eMouseCursor = 11 && Hourglass - that'll confuse 'em CASE nEffect = 1 && Copy eMouseCursor = 5 && Sizer OTHERWISE eMouseCursor = 3 && I-Beam, why not? ENDCASE |
See Also |