Microsoft KB Archive/147688

= Drag and Drop in Visual FoxPro =

Article ID: 147688

Article Last Modified on 8/24/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q147688



SUMMARY
There are various levels of Drag and Drop that an application can support. FoxPro only supports its application drag and drop, not OLE drag and drop (with the exception of using some OLE Controls).



MORE INFORMATION
When you drag Visual FoxPro objects around, only Visual FoxPro knows about them. OLE is not being used as the mechanism to alert windows that they are being dragged over. This means that you can't drop Visual FoxPro objects outside of Visual FoxPro.

When you drag OLE objects around (any object from an application that supports OLE Drag and Drop), Visual FoxPro does not know about them. This means that you can't drag text from Word and drop it into a Visual FoxPro edit box.

The only time OLE Drag and Drop will happen in a Visual FoxPro form is when an OLE application is in control of the area you are dropping into. If you have an OLE Control on a form, it handles all events for its window, so you can OLE Drag and Drop into it. If you have an in-place active OLE Insertable object in a form, it is handling events, so you can drag and drop into it. In neither case, is a Visual FoxPro DragDrop event fired because Visual FoxPro doesn't know that the drag is happening.

Steps to Demonstrate Behavior
 Start Visual FoxPro. Create a new form, and place an OLE Container control on the form. Add a second OLE Container control to the form, and select Microsoft Excel worksheet. Place a text box on the form.  Add the following code to the DragDrop event of each control: Wait Window " DRAGDROP FIRED" NoWait  Run the form. Start Word for Windows or WordPad. Type and select some text. Then drag it to the Visual FoxPro form. Notice that you can't drop the Word object onto the Visual FoxPro form.</li> Activate the Microsoft Excel OLE Container object, and repeat step 6. Notice that you can now drop into the in-place active Microsoft Excel object. No Visual FoxPro event is fired.</li></ol>

Additional query words: VFoxWin

Keywords: KB147688

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.