- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我目前正在开发一个带有 MapPoint-Control 的应用程序,这让我很难过。从 mappoint 也使用的线程启动 DoDragDrop
后,我总是在几秒后收到来自 mappoint 的对话框,说我的表单没有反应。
MapPoint-Control 是一个ActiveX-Control,使用该控件MapPoint 在后台启动并在不同的线程中运行。我认为 Mappoint 尝试更新控件但超时。
有没有办法在不同的线程中运行 DoDragDrop
,这样 MapPoint 就可以从主线程得到响应。或者是否可以告诉 MapPoint 我的表单当前已暂停。或者我可以以某种方式暂停 MapPoint 吗?
我已经尝试使用表单控件和 MapPoint-Control 运行 DoDragDrop
最佳答案
我发现了问题。
我在 BeforeClick
事件上触发了 DoDragDrop
。 MapPoint 可能会等待 Events 回调,但不会得到回调,因为 DoDragDrop
会一直保持 Event 直到鼠标被释放。
现在我已经编写了一个启动 DoDragDrop
事件异步到 MapPoint BeforeClick
-Event 的事件。
代码:
public event InitDragDropHandler InitDragDrop;
public delegate void InitDragDropHandler(object sender, object data);
public main()
{
this.InitDragDrop += new InitDragDropHandler(main_InitDragDrop);
}
void mappoint_BeforeClick(object sender, AxMapPoint._IMappointCtrlEvents_BeforeClickEvent e)
{
if (InitDragDrop != null)
{
this.BeginInvoke(new ThreadStart(() =>
{
InitDragDrop(mappoint, pps);
}));
}
}
void main_InitDragDrop(object sender, object data)
{
((Control)sender).DoDragDrop(data, DragDropEffects.Copy);
}
关于c# - 有没有办法暂停 ActiveX 控件 (MapPoint) 或异步运行 DoDragDrop?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4723098/
我有一个可以在我的窗体周围拖动的 UserControl。当控件被意外拖离我的表单并进入桌面时,我得到了第一次机会异常(例如): A first chance exception of type 'S
我真的很难在 Silverlight 4 中获得一个简单的拖放示例。 这是我所拥有的: XAML 代码隐藏 public partial c
在 WPF 中,我想使用右键单击来启动拖放。类似于 Windows 资源管理器,右键单击,稍微移动,你会得到装饰器来指示操作中的拖放。不要移动,松开按钮时会出现上下文菜单。 我已经启动了这一切,但是当
WPF DragDrop.DoDragDrop方法有 DragSource作为它的第一个参数。 有没有办法获得这个DragSource OnDrop 中的对象或其他拖放事件? 最佳答案 简短的回答是否
我已经为此苦苦挣扎了一段时间 我的应用程序包含一个 ListView ,填充了位于服务器上的文件名。 我正在尝试实现拖放功能,以便用户可以将文件从我的应用程序拖到他/她的本地计算机中。 为此,我首先将
我想知道在 Windows 窗体应用程序中调用 DoDragDrop 方法的控件是否有任何区别。 我有一个带有两个 PictureBox 控件的窗体。一个可以拖动,另一个的 AllowsDrop 属性
在类库中的定义为: 复制代码代码如下: [UIPermissionAttribute(SecurityAction.Demand, Clipboard = UIPermission
我正在将我的应用程序实现为拖动源。当我调用 DoDragDrop(Win32 调用,而不是 MFC)时,它进入模式循环,并且在 DoDragDrop 返回之前我不会在主窗口中收到重绘消息。不幸的是,如
我使用 DragDrop.DoDragDrop 将文件从我的 C# WPF 应用程序复制到 Windows 资源管理器。但是,文件的实际复制导致我的 WPF 应用程序卡住,直到复制完成。此复制操作可能
通过 DragDrop.DoDragDrop(...) 开始拖放操作后,不再触发 MouseMove 事件。我什至尝试过 AddHandler(Window.MouseMoveEvent, new M
我正在像这样拖放外部应用程序: string[] files = new string[/* */]; // get files DataObject o = new DataObject(DataF
我已经扩展了 Canvas {System.Windows.Controls} 和可拖动到 Canvas 中的项目。在拖动过程中,我有 OnDragOver 事件,当用户单击并按住鼠标中键时,我会在其
我有一个 WPF 应用程序,当拖动操作开始时,它在某些计算机上崩溃并出现 AccessViolationException。 困难在于它只发生在我们构建服务器的构建上,当我在 Visual Studi
在我的 WPF 应用程序中,我实现了拖放并将我的 PNG 图像放在 DataObject 中,然后将其传递给 DoDragDrop 方法。关于我可以放弃哪些应用程序,这似乎是偶然的。 Excel ye
我目前正在开发一个带有 MapPoint-Control 的应用程序,这让我很难过。从 mappoint 也使用的线程启动 DoDragDrop 后,我总是在几秒后收到来自 mappoint 的对话框
我的应用程序有一个简单的功能,它连接到 Excel 并在它们之间进行拖放操作。具体来说,我只是从我的应用程序中获取一些文本值,将它们拖到 Excel 中,然后放下。 这在 90% 的时间都有效,但奇怪
我是一名优秀的程序员,十分优秀!