Partilhar via


Design-Time OLE Drag-and-Drop Support

Design-time support for OLE drag-and-drop in Visual FoxPro makes developing applications even faster than previous versions. OLE drag-and-drop makes it easy to drop files into the Project Manager and the Visual FoxPro designers from the Windows Explorer. Text can be easily moved or copied from other applications to the Command Window, the Visual FoxPro text editors, and the Properties Window.

The following table lists the Visual FoxPro design time features that support OLE drag-and-drop with a description of the support.

Interface item Description
Command Window Drop target for files, drag source and drop target for text.

If a file created in Visual FoxPro is dropped on the Command window, the file is opened with the appropriate Visual FoxPro command. For example, if a database is dropped on the Command window, Visual FoxPro issues the OPEN DATABASE and MODIFY DATABASE commands to open the file for modification. If a table is dropped on the Command window, the table is opened with the USE AGAIN and BROWSE commands. If SET EXCLUSIVE is ON, the table is opened for exclusive use. If SET EXCLUSIVE is OFF, the table is opened for shared use.

Other Visual FoxPro files are opened with the appropriate MODIFY command — forms are opened with MODIFY FORM, queries are opened with MODIFY QUERY, text and header (.H) files are opened with MODIFY FILE, and so on.

If a file that has been created in another application is dropped on the Command window, the file is opened in the application with which it is associated. For example, dropping a Microsoft Excel spreadsheet on the Command window starts Excel and opens the spreadsheet.

Project Manager Drop target for files.

Files are added to the appropriate Project Manager categories, based on their file extensions. If a file with an extension Visual FoxPro does not recognize is dropped on the Project Manager, the file is added to the Other category.

If a table contained in a database is dropped on the Project Manager, the database is added to the Databases category of the Data item and is marked as Excluded. If a free table is dropped on the Project Manager, the table is added to the Free Tables category of the Data item and is marked as Excluded. If a database is dropped on the Project Manager, the database is added to the Databases category of the Data item and is marked as Excluded.

While OLE drag-and-drop makes it easy to add files to the Project Manager, remember that the Project Manager automatically adds any referenced files to the project when you build the project. For example, if a program you add to the project executes a second program, the second program is automatically added to the project when the project is built. It isn't necessary to manually add the second program to the project.

Text Editors Drag source and drop target for text.

Text editors include editing windows opened with MODIFY COMMAND, MODIFY FILE, and MODIFY MEMO, the Command window, snippet editing windows in the Form, Class, Menu, and Data Environment Designers, and the Stored Procedure editor in the Database Designer.

Debugger Drag source and drop target for text.

The Watch window text box and Name list are drag sources and drop targets for text. The Trace window and the Debug Output window are drag sources for text.

Database Designer Drop target for files.

Dropping a table onto the Database Designer adds the table to the current database.

Class Designer Drop target for text and files.

By default, dropping text on a container object in the Class Designer creates a label with the text as the value of its Caption property. You can change the default control created when text is dropped on the Form Designer in the Field Mapping Tab of the Options Dialog Box.

If you drop text onto a non-container control (a CheckBox, CommandButton, Header, Label, or OptionButton control), the Caption property is set to the text.

Dropping a graphics file (.ani, .bmp, .cur, .gif, .ico, or .jpg) onto the Class Designer creates an Image control with the Picture property set to the name of the graphics file.

Data Environment Designer Drop target for files.

Dropping a table onto the Data Environment Designer adds the table to the data environment. Dropping a database onto the Data Environment Designer displays the Add Table or View dialog, making it possible for you to add a table or view to the data environment.

Query Designer Drop target for files.

Dropping a table onto the Query Designer adds the table to the query. Dropping a database onto the Query Designer displays the Add Table or View dialog, making it possible for you to add a table or view to the query.

View Designer Drop target for files.

Dropping a table onto the View Designer adds the table to the view. Dropping a database onto the View Designer displays the Add Table or View dialog, making it possible for you to add a table or view to the view.

Properties window Drop target for text.

You can drop text onto the text box that appears at the top of the Properties window when a design time property is selected.

Component Gallery Drag source and drop target for files.

You can drag objects out of the Component Gallery and drop them onto the Form Designer. You can also drag files out of the Component Gallery and drop them onto the Project Manager.

Files can be dropped on the Component Gallery.

See Also

OLE Drag-and-Drop | Run-Time OLE Drag-and-Drop Support | Implementing Intrinsic and Manual OLE Drag-and-Drop Modes | Interoperability and the Internet | Active Documents