Add OLE Drag and Drop Functionality

Implementing OLE Drag and Drop

In this exercise, you will use Visual Basic to create an application that supports drag-and-drop functionality.

* To add drag and drop support to an application

  1. Start Visual Basic and create a new Standard EXE project.
  2. Add two picture controls to the form.
  3. Set the OLEDragMode and OLEDropMode properties of both controls to Automatic .
  4. Add a bitmap image to the Picture1 control.
  5. Start the application and drag and drop the bitmap from Picture1 to Picture2 .
* To add drag-and-drop support between applications
  1. Stop the application and add a textbox to the form.
  2. Set the Multiline property of Text1 to True .
  3. Clear the text field.
  4. Set the OLEDragMode and OLEDropMode property of the control to Automatic .
  5. Start the application.
  6. Start Microsoft Word and create a new blank document.
  7. Position the windows so you can see both at the same time.
  8. Type Hello World! in the Word document.
  9. Highlight the text and drag and drop it into the text box on the Visual Basic form.
  10. Drag and drop the bitmap from the Picture1 control into the Word for Windows document.
  11. Stop the Visual Basic application.
  12. Exit both Word for Windows and Visual Basic.


Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net