DragDrop Windows 7问题 [英] DragDrop Windows 7 Problem
问题描述
我正在使用Windows 7和Visual Studio开发C#应用程序,但遇到了一个烦人的障碍.我正在尝试在没有对象的窗体上使用DragDrop事件,但是当我尝试将文件拖到窗体中时,它始终有一个被阻止"的光标,并且不会让我删除该文件.它在Windows XP中对我有效,最近我进行了升级,发现我无法再删除该文件.如果自从我上次尝试以来已经有一段时间了,如果有人可以为此提供帮助或让我刷新如何做,将不胜感激.谢谢.
Hi, I am using windows 7 and visual studio to develop C# applications, but I''ve run into an annoying roadblock. I''m trying to use the DragDrop Event on a form with no objects in it, but when I try to drag a file into it, it always has a "blocked" cursor and wont let me drop the file. It worked for me in Windows XP and I recently upgraded and found I am unable to drop the file any more. If someone could provide assistance for this or refresh me on how to do it since it was a while ago since I''ve tried it last, it would be greatly appreciated. Thanks.
推荐答案
您是否尝试过在Windows 7中使用API CodePack的ShellObjectCollection
.我认为Win7 Shell中有相当多的增强功能,并且在代码包中执行此操作的示例应用程序.
我认为您应该绝对尝试该示例.
检查这里:
http://code.msdn.microsoft.com/WindowsAPICodePack [
Did you tryShellObjectCollection
of API CodePack in Windows 7. I think there is considerable amount of enhancement is made in Shell of Win7 and there is also a sample application of doing exactly this in the codepack.
I think you should try the sample definitely.
Check here:
http://code.msdn.microsoft.com/WindowsAPICodePack[^]
:thumbsup:
收听DragEnter事件.当触发时,将e.Effect设置为某些允许的效果.然后,您的表单应该允许放置.
Listen for DragEnter event. When that fires, set e.Effect to some allowed effect. Then your form should allow drops.
好吧,我从网上得到的是"Windows 7用户帐户控制不允许拖放".链接到该网站:
http://weblogs.asp.net/jeffwids/archive/2010/04/28/windows-7-user-account-control-does-not-allow-drag-and-drop.aspx
well, what i got from the net is that "Windows 7 User Account Control does not allow drag and drop". Link to the site:
http://weblogs.asp.net/jeffwids/archive/2010/04/28/windows-7-user-account-control-does-not-allow-drag-and-drop.aspx
这篇关于DragDrop Windows 7问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!