Mouse Cursor for Drag/Drop

I’m looking for a way to change the mouse cursor during a drag/drop during the drag over. This would be for dragging FROM Finder into my app, so the drag isn’t being initiated from within my app, just dropping onto it.

Basically I want the mouse cursor to change if the drag is over top of an area in my app which can accept the drop. Right now it’s just the regular arrow cursor no matter where you are dragging, so the user doesn’t know if it’s a valid drop area.




Use the DragOver Event to change the MouseCursor ?

1 Like

I thought that’s only if the DragObject is created within my app. But I’ll give it a try.

There’s also DragEnter and DragExit.

IIRC You need to use application.cursor otherwise Xojo will overwrite it with what it thinks is the best cursor, even when using app.cursor, sometimes Xojo still overwrites it.

I have a Feedback for this, at wrong 'puter can’t look right now.

It seems that my problem is that when the mouse is depressed (which it would be during a drag), none of the mouse cursor changes happen until releasing the mouse. So that doesn’t help, since I need the cursor to change during the drag.

So it would be much like dragging a file in the finder, and the cursor changing to the “+” (copy) cursor, or if making an alias, etc.

Ideas anyone?

Even with code to change in DragEnter / DragExit (Sam guess) ?

In the Finder (yes, I know), when I move an image file onto the Cmd-J windoid file (I forgot the name), the image area, a green circle with a white + appears nears the cursor.

Something may be possible.

The DragOver event should execute while the mouse is pressed (it’s designed for that). Did you make sure the event is called, first?

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.