views:

54

answers:

1

Is it possible to allow the controls inside a FlowLayoutPanel to be user draggable so that they can be reorganized. If I have a list of labels, I would like to drag and move them around, much like the icons on your desktop. I would like to grab label A and put it in between label B and C.

Another option, is that if there is another container control that allows this out-of-the-box, I would probably prefer it to coding a drag and drop handler for the FLP.

EDIT: I'm using WinForms.

+1  A: 

You can use FlowLayoutPanel.SetChildIndex() to reorder controls within it through code.

Or, you can use some drag/drop reordering for an itemscontrol, and change the template to use a flowlayoutpanel for the items. Here's a related question on SO that does the same thing for a wrappanel, but would probably easily work for a flow panel: http://stackoverflow.com/questions/2108712/wpf-reorder-wrappanel-content-via-drag-and-drop

Philip Rieck