Drag and Drop

Drag and Drop to and from Matlab Figure
3.8K Downloads
Updated 10 Sep 2007

No License

Example Drag and Drop in Matlab Figures from Windows Explorer or Other Apps

DrapDropTest creates a simple figure which shows the implementation of dnd using activex.
The microsoft RichtextCtrl.1 activex control is used to demonstrate dnd ability. The control
has several events to which matlab can respond, in particular the OLEDragDrop Event.

Type DragDropTest from the command line to test. Once the figure is
running try dragging a text file into either of 2 areas on the figure.
The upper portion will just populate a listbox with the names of files
that have been dragged into the bar above it. The lower box displays the
contents of any text file dragged into it. The bottom box also allows
text to be dragged from a text editor such as wordpad.

This example is not intended to be robust, so please feel free to use it,
but make sure to check over the code in detail to make sure it doesn't
break. I've just coded this quickly to demonstrate the property. Feel
free to email me with questions comments.

Cite As

Raphael Austin (2024). Drag and Drop (https://www.mathworks.com/matlabcentral/fileexchange/16312-drag-and-drop), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Printing and Saving in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0