为什么我的WPF应用程序有拖& Drop禁用(即使AllowDrop为真)? [英] Why my WPF application has Drag & Drop disabled (even when AllowDrop is true)?

查看:710
本文介绍了为什么我的WPF应用程序有拖& Drop禁用(即使AllowDrop为真)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的WPF应用程序禁止从Windows资源管理器中删除文件,显示一个停止标志光标。



我试过设置AllowDrop属性(UIElement祖先)在主窗口上为true并包含控件,但根本没有运气,没有拖放事件被触发。



找到原因的任何想法或建议?

解决方案

已解决



问题是, VisualStudio(运行/调试)阻止了Windows的拖放操作下降机制。运行应用程序是独立的,使其工作,但无法交互调试。



此答案帮助很多:
Visual Studio 2010 WPF项目运行在调试或相关不允许拖放到任何控件


My WPF application inhibits the Drop of files from Windows Explorer, showing a Stop-sign cursor.

I've tried setting the AllowDrop property (that of the UIElement ancestor) to true on the main window and contained controls, but no luck at all, no drag-drop events are fired.

Any ideas or suggestions to find the cause?

解决方案

Solved!

The problem was that executing my app thru VisualStudio (run/debug) prevented the interop with Windows' drag & drop mechanism. Running the App as stand-alone makes it work, but cannot debug interactively.

This answer helped a lot: Visual Studio 2010 WPF Project ran in debug or relase will not allow drag and drop to any control

这篇关于为什么我的WPF应用程序有拖& Drop禁用(即使AllowDrop为真)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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