问题描述
我在用户控件库中创建了一个用户控件.我为拖放添加了功能,在构造函数中,我将控件分配给了使用的事件处理程序.
当我需要一个新的用户控件,并将其添加到VS中时,然后进行拖动即可正常工作.但是,当我在运行时创建用户控件时,拖动不再起作用了吗?在运行时,我使用
创建用户控件
Hi,
i created a User Control in am User Control Library. I added funktionallity for drag and drop, in the Constructor i assign the Control to the used Event handlers.
When i need a new User Control, and i add it in VS, then dragging works fine. But when i create a User control during runtime, dragging does not work any more? During Runtime i create the user Control with the
myLibrary.myUserControl myControl = new myLibrary.myUserContro();
http://msdn.microsoft.com/en-us/library/cc189066 (v = vs.95).aspx [ ^ ]
我的逻辑围绕用户控件看起来像这样.如果用户控件是通过VS添加的,则有效,但如果是在运行时添加的,则无效.
有任何想法吗?
greets
http://msdn.microsoft.com/en-us/library/cc189066(v=vs.95).aspx[^]
My Logic for moving around the User Control looks like this. Works if the User Control is added via VS, but not if added during Runtime.
Any Ideas?
greets
推荐答案
这篇关于可拖动的用户控件不会拖动!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!