Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others


0 votes
in Technique[技术] by (71.8m points)

delphi - Drag/Drop inside an Application AND to another Application

I have a ListView containing file names. These file names need to be draggable to a TreeView, which is a drag/drop inside the application and works with the built in drag/drop support of Delphi - no problem. But I must also be able to drag/drop the ListView items to another application, e.g. Windows Explorer. This also works, for example using a DragFileSource component of Anders Melander's Component Suite (http://melander.dk) which start its work in the ListView.MouseDown event, so there is not really a drag/drop operation initiated.

Basically, I would need the same behaviour as you can see in a Windows Explorer: You can drag an item to another folder inside the application and also to another application.

How can this be done in Delphi? I guess there should be a "drag" initiated, but when the mouse moves outside the app window, it needs to "switch" to the other functionality, and should the mouse move back to the app window, again back to the standard drag drop.

Thanks for any help!


See Question&Answers more detail:os

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The Drag and Drop Component Suite you mentioned does this. You can initiate a drag which you can drop in your own app or other apps by default. Just pick the right clipboard format that other applications understand. What is your problem with it?

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share