使用WPF ListBox拖放 [英] Drag and Drop with WPF ListBox

查看:358
本文介绍了使用WPF ListBox拖放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WPF应用程序中我有两个 ListBox 。一个是源第二个是目的地。我从文章 http://dotnetslackers.com/ADO_NET/re-191632_Generic_WPF_Drag_and_Drop_Adorner.aspx

I have two ListBox in WPF application. One is the source second is the destination. I took the help from the article http://dotnetslackers.com/ADO_NET/re-191632_Generic_WPF_Drag_and_Drop_Adorner.aspx

现在我已经设法执行拖放操作。

Now I have managed to perform the drag and drop.

现在我有一个功能可以实现,如果我们将任何项目放在现有项目上,它将使用当前拖动的项目替换现有项目。

Now I have one feature to implement in which if we drop any item over an existing one, it will replace the existing item with the current dragged item.

请指导。

推荐答案

您可能需要查看 Gong解决方案拖放WPF ,该指南使用的是adorner,应该能够向您展示如何删除旧项目并添加新的项目,如@kenny所建议的。

You may want to look at Gong Solutions Drag/Drop for WPF, the guide it uses an adorner and should be able to show you how to remove the old item and add a new one, as @kenny suggested.

这篇关于使用WPF ListBox拖放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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