0

I have this problem. I have multiple images that I want to display inside a container, then the user can reorder them using "drag and drop" inside the container. After that I have to "understand" the new order and retrive some informations, like the tag, in the new order.

I have tried using listView and imageList but the problem is that if I have images with different sizes they aren't handled in the right way, because you can set just a size (with and height) for all of the images in the imageList.

Is there any other container, or othere strategies, that are more flexible?

Thanks

  • 1
    Can't you just add images as pictureboxes in a regular panel? See also https://stackoverflow.com/questions/3213270/how-to-set-z-order-of-a-control-using-winforms – JonasH Dec 11 '20 at 10:20
  • 1
    Yes, this calls for pictureboxes, maybe in a flowlayout panel or in a TableLayoutPanel. – TaW Dec 11 '20 at 11:45
  • Ok, I'll try this solution! Thanks! – Luca Venturini Dec 11 '20 at 12:58
  • Note: PictueBox can Zoom in/out to display the images in any size. TLP will have fixed row- and column-sizes while FLP will try to fit conrols of any sizes into its area – TaW Dec 11 '20 at 14:55

1 Answers1

0

If you're interested in leveraging a commercial product, the LEADTOOL SDK has components which contain this functionality (note I work for this vendor). The ImageViewer component have interactive modes which can be extended for drag-and-drop reordering functionality. https://www.leadtools.com/help/sdk/v21/dh/c/imageviewerinteractivemode.html

There's a demo available on the site which already showcases what you're looking for: https://demo.leadtools.com/JavaScript/DragDrop/

A .NET example is also available. https://www.leadtools.com/support/forum/posts/t12446-HOW-TO--Rearrange-pages-in-the-LEADTOOLS-Virtual-Document