问题描述
在WPF应用程序中我有两个 ListBox
。一个是源第二个是目的地。我从文章
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.
请指导。
推荐答案
您可能需要查看,该指南使用的是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拖放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!