拖曳从表单下载到Windows;放下目的地 [英] Drag & Drop from Form to Windows; get drop destination

查看:161
本文介绍了拖曳从表单下载到Windows;放下目的地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发VB.NET中的一个应用程序,该应用程序需要将控件对象(例如ListViewItem)从表单中拖出,并将其拖动到用户指定的位置(例如桌面或一个文件夹)。



但是,ListViewItem表示的打算复制的文件尚不存在。它需要下载,然后放在用户指定的位置。我能得到目的地的路径/位置吗?我会继续下载文件,然后将其放在使用指定的地方。



我已经看过有关相似的问题,其中详细介绍了窗体之外的拖动操作,它似乎并不是一种方式确定哪个快捷方式去哪里或如何标记目标位置。



本质上,我认为它可能需要某种动态链接或虚拟文件正如我在其他地方所看到的那样。然后,在删除操作后,以某种方式从我的应用程序访问此链接,继续下载该文件并将其放在最终放置目的地。



任何帮助不胜感激,谢谢提前!





结论:



Roger Lipscombe提供了一个链接,其中包含链接到其他文章,看起来是有希望的信息。
以下链接可能有助于实现拖放操作,而无需提供托管代码中所需的确切数据。




解决方案

你真的想知道哪里文件被丢弃了?还是你不想提前提供数据?



如果是后者,Raymond Chen有一个整体系列实现虚拟拖放,在本机代码中。 David Anson 将其转换为托管代码添加异步支持


I have been developing an app in VB.NET which requires a control object (for example, a ListViewItem) to be dragged out of the form, and to a user-specified location (for example, on the desktop, or in a folder).

However, The file that is intended to be 'copied', as the 'ListViewItem' represents, does not yet exist. It needs to be downloaded and then placed in the user specified location. Am I able to get the path/location of the destination drop? I would then proceed to download the file, and then place it where the use specified.

I have looked at other questions regarding a similar issue, which details the dragging operation outside the form, its just there doesn't appear to be a way to determine where that short cut went or how to flag the destination location.

Essentially, I am thinking that it may require some sort of 'dynamic link' or 'virtual file' as I've seen mentioned elsewhere. Then, after the drop operation, somehow accessing this 'link' from my application, proceed to download the file and place it in the final drop destination.

Any help is appreciated, thanks in advance!


OUTCOME:

Roger Lipscombe provided a link that contained links to other articles, with what looks to be promising information. The following links may prove useful in implementing a drag drop operation without providing the exact data that is required in managed code.

解决方案

Do you really want to know where the "file" was dropped? Or do you just not want to provide the data up front?

If the latter, Raymond Chen has a whole series on implementing virtual drag and drop, in native code. David Anson translates it into managed code and adds asynchronous support.

这篇关于拖曳从表单下载到Windows;放下目的地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆