How to control the cursor symbol during a DragDrop

D

**Developer**

I have a Listbox application.
I allow users to drag items from one spot in the listbox to another spot.
I also allow them to drag to, say, WordPad

In the DoDragDrop I use DragDropEffects.Copy so that when dragging to
WordPad the copy cursor will show.
(If I use "DragDropEffects.Move Or DragDropEffects.Copy" WordPad show the
move cursor.)

But when the user moves an item from one spot to another in the listbox I'd
like the Move cursor to show.
(Because I do not copy the item I move it)
I've tried in the DragEnter to return DragDropEffects.Move but I think
because DragDropEffects.Move is not included in the DoDragDrop I then get
the slashed-circle cursor.

The question then is: How can I use only DragDropEffects.Copy in the
DoDragDrop so WordPad show the copy cursor and still show the move cursor
when the mouse cursor is over my ListBox?



Thanks
 
C

Cor Ligthert [MVP]

Developer,

Did you have a look at all kind of hoover events like Enter, MouseHoover,
MouseLeave etc etc.

I hope this helps,

Cor
 
D

**Developer**

I've implemented them all. Can I specify the cursor shape in one of them.
I think I did that a long time ago but am not sure.
I am sure that if I did I forgot how.


Thanks
 
D

**Developer**

Huh, I hadn't thought of doing that.
The Drag methods change the cursor depending on what e.Effect is set to so
I was focused on telling the drag system what cursor to use.
I'll try changing the cursor in the drag events but am not sure if that will
be overridden by the drag system.
So I'll see.
Unless someone suggest a more structured method.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top