Hi guys,

I've been playing around with drag and drop for the first time and got it working all correctly. Except, I need a way to determine the source object that the payload came from.

Since at the moment I'm moving between listboxes and treeviews I could just include the sender in the payload (as it's text), however, if I decide later on I want to move other data as well, is there a more elegant way of finding the source object? (I guess another way would be too have a private variable that keeps track of the drag and drop operations and stores the sender)

The sender parameter obviously returns the destination object as it is the one calling the DragDrop event handler.

If anyone knows of an elegant way to determine the sender object then this would be appreciated.

Thanks.