1
votes

I have to create a listview with draggable items. I found a solution in codeproject

http://www.codeproject.com/Articles/17266/Drag-and-Drop-Items-in-a-WPF-ListView?fid=378031&fr=51&df=90&mpp=25&prof=False&sort=Position&view=Normal&spc=Relaxed#xx0xx

That's the best code found over net. Now I need to change the drag cursoe to sizeAll.

Is there any ways to change the default dragging cursor?

1

1 Answers

2
votes

I downloaded the program you linked to.

To achieve what you want add this in ListViewDragDropManager.cs's #region Hook Events region:

this.listView.GiveFeedback += listView_GiveFeedback;

And then add this to the #region Event Handling Methods part:

private void listView_GiveFeedback(object sender, GiveFeedbackEventArgs e)
{
    if (e.Effect == DragDropEffects.Move)
    {
        e.UseDefaultCursors = false;
        Mouse.SetCursor(Cursors.SizeAll);
    }
    else
        e.UseDefaultCursors = true;

    e.Handled = true;
}

Don't forget to unsubscribe in the #region Unhook Events part:

this.listView.GiveFeedback -= listView_GiveFeedback;