I have used the demo here. All works well.
http://code.msdn.microsoft.com/Word-2010-Using-the-Drag-81bb5bff
However, when I try and swap out the listbox for a treeview, it just doenst want to play.
5 minutes to get the demo working and over 2 hours now trying to use the tree view instead. IT shouldnt be that hard surely?
Relating specifcally to the demo mentiond above and my modfiication from a listbox to a tree view:
There is a test on “e.Data.GetDataPresent” which determines the “effect” of the cursor/pointer as it is moving across the GUI – from the tree view in the task pane to over the document (With the effect being set in a ItemDrag event in this instance).
A “DragEnter” event is rasied when the cursor is then moved over the document (well a form overlaid on the document), If data is not found, the effect is set to “DragDropEffects.None”.
This will mean when dropping the item on the document (via the invisibile overlaid form) the “DragDrop” event will not be raisd as “DropEffects.None” stops this.
The problem was surrounding my test of data bing present in the DragEventArgs.Data property.
The interesting thing, though, is the affect of “DragDropEffects” and its side effect on other events.