views:

121

answers:

2

I'm trying to drag a listitem from a listbox onto a picture box.

The list item is a persons name. The value member of the list item is the ID of the people listed.

When I drop the list item onto the picture box I want to use the persons ID to query a photo and load that photo.

I can't seem to access the value though, only the name text, using e.Data.GetDataPresent where e is the DragEventArgs.

Could someone point me in the right direction?

A: 

you need to declare the selected value as a string and then pass this to the dodragdrop event properties. this is done on the object you use the mousedown command to drag from

clements
A: 

to drag to a picturebox you have declare it on form load as picturebox1.allowdrop = true. the intellisense doesn't show this option but it is valid

clements