DropObject on a Canvas

Hi All.

I am having a problem that I can’t figure out. Big surprise, huh.

Anyway, I want to drop a folder onto a Canvas so that I can process the files within it. So I have a Canvas, as I said, and within it, I have created a DropObject event.

Right now, when I drop a folder (real folder, not alias) onto it I want a Messagebox “Dropped”. When I try, nothing happens.

Any ideas?

Regards

Update: I’m getting closer. I put, in the Opening for the Canvas:

Me.AcceptFileDrop(“image/png”)
Me.AcceptFileDrop(“image/jpeg”)
Me.AcceptFileDrop(“image/tiff”)

And now at least I am getting my dropped message.

Regards


Add a FileTypeGroup (Insert Menu), then click in the left button and select special/any.

Then in the Accept line add the reference of the FTG.

There are examples (not for folder) on how to use drop items from disk.

Here a project example:
Testing Drag.xojo_binary_project.zip (5.1 KB)

Thank you for the help, Emile. Your explanation made perfect sense. And your example was very helpful.

Once again, thank you for your time.

Regards

1 Like