Drag and drop into another application - don't think its possible....

  • Thread starter Thread starter Robin Tucker
  • Start date Start date
R

Robin Tucker

Apologies for the ambiguous title, you will be expecting me to be asking how
to perform drag and drop from my application into another application.
Well, kind-of. I've got drag and drop sorted, apart from one thing. I'm
dragging and dropping items from my treeview and listview which represent
database "Images" (blobs). Now, I don't store the blob in the tree, I fetch
it when I need it. This is a problem for drag and drop, because, for
example, I want the user to be able to drag and drop some nodes into
explorer and for my application then to extract the data blobs from the
database and save them as files. Is this possible?
 
Robin,
I have not tried it, I would save the nodes as temp files before I started
the Drag Drop operation (you can use System.Environment.GetFolderPath to get
the location of the Temp folder).

Then I would add the nodes to your DataObject as DataFormats.FileDrop. When
you add FileDrop to the DataObject you need to add an array of Strings that
represent the file names, hence storing the nodes as temp files first.

I would then expect if you dropped the nodes on WIndows Explorer it would
see the FileDrop format & deal with the underlying temp files...

Hope this helps
Jay
 
Back
Top