Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 FlowLayoutPanel 和 UserControl 的拖放重新排序。这类作品。但问题是子控件阻止拖动实际的父 UserControl。
所以我的问题是如何启用包含子控件的 UserControl 的拖动?
如果我理解正确,我遇到了和你一样的问题,我通过将子元素的事件传播到它的父元素来解决它。
如果您有一个包含标签的可拖动用户控件。当标签的事件发生时,您必须调用 UserControl 的事件。例如,在标签的 OnMouseDown() 中调用 UserControl 的 OnMouseDown() 并传递 Event-Args。我没有找到比单独处理拖放所需的每个事件更好的方法。