如何将任何ui控件从stackpanel拖放到wpf中的canvas [英] How to drag n drop any ui control from stackpanel to canvas in wpf
本文介绍了如何将任何ui控件从stackpanel拖放到wpf中的canvas的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在研究wpf项目。我在网格中有两个控件堆栈面板n画布我想将堆栈面板的按钮拖动到画布上plz帮助我asap
谢谢
Hi,
I m working on wpf project.I have two controls stack panel n canvas in a grid I want to drag button of stack panel to canvas plz help me out asap
thanks
推荐答案
我假设您要从stackpanel中删除子项并将其添加为新子项画布。
看看这篇文章开始
在画布中拖动元素 [ ^ ]
这不是解决你所有的问题,但它会让你在右边跟我想。
希望这会有所帮助。
I am assuming that you want to remove the child from stackpanel en add it as a new child to the canvas.
Have a look at this article to start
Dragging Elements in a Canvas[^]
This is not solving all your problems but it will put you on the right track i think.
Hope this helps.
你好
如果您需要工具箱功能,可以尝试sukram的 WPF图表设计器 - 第2部分 [ ^ ]
如果你只需要从一个控件拖动到另一个控件,并且你正在使用MVVM,你可以考虑我的 WPF UIEventHub - MultiSelect和DragnDrop [ ^ ]并进行一些修改以满足您的需求。 (触摸支持)。
问候
Joseph Leung
Hello
If you need Toolbox functionality, you can try sukram's WPF Diagram Designer - Part 2[^]
If you merely need to drag from one control to another, and you are using MVVM, you may consider my WPF UIEventHub – MultiSelect and DragnDrop[^] and do some modification to suit your needs. (touch supported).
Regards
Joseph Leung
这篇关于如何将任何ui控件从stackpanel拖放到wpf中的canvas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文