I need a drag and drop control for C# winforms

痞子三分冷 提交于 2019-12-11 11:01:55

问题


I'm looking for a control for C# that can contain other controls, takes care of layout and allows drag and drop rearranging of the layout order.

Simularly to the way the iphone/ipod allows you to rearrange apps.

Thanks.


回答1:


Using something like DockPanelSuite as a basis might be a good starting point.




回答2:


I think you can implement your own easily, using FlowLayoutPanel and MouseUp, MouseDown, MouseMove events of the controls where you change the Location property approximately and FlowLayoutPanel should handle it.




回答3:


Just create your own. You can intiate a DragDrop operation (usually in OnMouseDown) by calling the DoDragDrop() method of your control. You can override the OnDragOver and OnDragDrop methods of your controls which will accept a dragged object. Resizing is already built in, you just need to set the properties (given, it can be a bit of a pain.)



来源:https://stackoverflow.com/questions/549911/i-need-a-drag-and-drop-control-for-c-sharp-winforms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!