0

For a treeview I want to have a drag-image (seems to be called ghostimage sometimes) to enhance the user experience.

Right now there is just have a mouse cursor with an empty rect below of it (where the image should go).

Now I found this codeproject article which is very old (2005), so I hope there is something better.

In this blogpost on drag and drop the way to go is an adorner, which seems quite complicated for what I want to have, which is just the dragimage.

This is default dragging behaviour in most other UI frameworks I know.

Is there no easier way to get an drag-image than an adorner?

Any comments highly appreciated!

Charles
  • 50,943
  • 13
  • 104
  • 142
Mare Infinitus
  • 8,024
  • 8
  • 64
  • 113
  • 1
    True drag+drop, not the adorner hack, requires changing the *cursor*. That used to be tricky until Vista, you can now create one from a PNG image. So what you have to do is render whatever drag image you want to a PNG and get it saved in the cursor format. You can get an ugly one from [this kind of code](http://rogers-neighborhood.com/wordpress/?p=55), a pretty one from [this code](http://stackoverflow.com/a/21389253/17034). Change the 2nd value from 1 to 2. – Hans Passant Feb 05 '14 at 11:46
  • @HansPassant Thank you very much. Changing the cursor seems to have its own implications. Perhaps the quickest way is following the "adorner hack", at least as I just want the image there. – Mare Infinitus Feb 05 '14 at 13:16

0 Answers0