Thursday, March 31, 2011

I need a drag and drop control for C# winforms

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.

From stackoverflow
  • 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.

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

  • 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.)

0 comments:

Post a Comment