Link to home
Start Free TrialLog in
Avatar of pcjunky
pcjunky

asked on

Drag Drop between runtime created pictureboxes and designtime created pictureboxes

I'm trying to make an image browser, where the images in a particular(user chosen) are loaded dynamically into a scrollable panel(I've got this part working).  I'd want to be able to drag an image from the panel into one of three other picture boxes which  uploads the picture to particular site based on which box it is.  I've got the uploading working as well, when dragging an image from windows explorer.  The problem I'm having is when I try to drag from the scrollable image panel to one of those three picturboxes.  I don't know how to pass the information along.  When I dynamically add the pictureboxes to the panel I also assign an eventhandler to handle the moving of the image via mousemove(I'm not even sure if this is the event I should be capturing or not), but apparently I'm not doing something right because when I drop the image on the destination picturebox the sender has no data.  Any ideas?  If a look at the code I'm using would help let me know and I'll post it.  Thanks in advance.
~pcjunky
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pcjunky
pcjunky

ASKER

Seems to work like a charm.  Thanks Idle_Mind.  After walking through it I found that on the drop that the dataobject was empty, but didn't know how to set it;  I was just missing the the line to set the data:

data.SetData(DataFormats.FileDrop, files)

~pcjunky