Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-order images by dragging

Status
Not open for further replies.

timmah13

Programmer
Feb 25, 2003
12
US
I have multiple images that are named in sequential order (i.e. Image01.jpg, Image02.jpg, etc.). I would like to give the user a way to re-order the images visually by simply displaying all images in the current sequential order and allowing the user to drag images into the desired order. After that, I'll rename the image files based on the new sequential order.

I plan to display the images as thumbnails using an Image control array. I'd like to have it work similarly to the "Links" toolbar on Internet Explorer when rearranging links. Any thoughts on the easiest/best way to display and drag images?

Thanks in advance.
 
My thought on this would be to create an array of Image controls. The controls must be layed out in position where you want them to appear.

Instead of dragging the actual control from place to place, you'll actually click on an image you wish to drag, then click on the destination control.

This way you maintain image positions more effectively using the index property of the image controls.

When everything is in order, re-save all the image files and concat. the index property with the filename.

Good luck! [fish] No Dolphins were harmed in the posting of this message... Dolphin Friendly Tuna!
 
By the way, create only one or two image controls on the form, then load the necessary additional image controls as needed. I would also have a hidden image control to help in the transfer of the images.

Suppose you want to move image #5 to image #1... Everything must shift over (+1), between 1 and 5. Place image 5 into a holder or save it to a temp location. Shift the current image 4 to image 5, the current image 3 to 4, image 2 to 3, image 1 to 2, then 5 to 1 from the temp location.

I really hope this helps you out. I'm taking a day trip to Austin but when I get back, if you still need assistance I'll help you with this. (provided that CClint, vb5er, strongm, cajuncenturion, semperfidownuda, Zemp, DrJavaJoe, Johnwm, ADoozer or anybody else I'm forgetting haven't already fixed you up)... X-) [fish] No Dolphins were harmed in the posting of this message... Dolphin Friendly Tuna!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top