Is it possible to create a cursor in WPF from VisualBrush?

I am performing drag and drop operations and want to use a visual copy of the element that I am dragging for the cursor. It is easy enough to get a VisualBrush element, but I have no idea how to turn this into a cursor.

I read Jamie Rodriguez's posts , but his solution is not exactly what I'm looking for, because he essentially wires things up to the "global" GiveFeedback event (his DragSource). I would rather just take the image from VisualBrush and make it a cursor. Is it possible?

+3
source share
1 answer

Usually (both in the above example and in this Bea Stollnitz example ) this is done using Adorner.

If you really wanted to change it yourself Cursor, you would need to create a .cur file in memory and pass it to the Cursorconstructor . I have never done this, and I do not recommend it, but I think it should be possible.

+3
source

Source: https://habr.com/ru/post/1704930/


All Articles