Skip to content

Handling the cursor when moving the files using drag drop #4844

Description

@itg-assistant

Ravi Keshwani asked 2025-09-01 06:50:30 UTC

When dragging a file or files if the location is valid example folder the cursor should be changed to move and if not it should show block cursor. This is my code in DragOver event but the cursor is not taking effect.

if (IsValidDropTarget(targetItem))
{
e.Effect = DragDropEffects.Move;
this.Cursor = Cursors.Arrow;
string folderName = GetCleanFolderName(targetItem["CloudFileName"]?.ToString());
DragVisualHelper.UpdateFloatingLabelWithColor($"Drop into {folderName}", Color.Brown);
}
else
{
DragVisualHelper.UpdateFloatingLabelWithColor(dragText, Color.AliceBlue);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions