How to make AcceptFileDrop working on Win10?

Hello

I want to allow users to drag & drop specific files onto the Window and then react on it (Desktop app, latest Xojo2019.x) . It works on Mac but on Windows 10 it shows me a red blocking sign as soon as I hover the Window with a valid file type.

MainWindow.open

Var FileType As New FileType FileType.Extensions = "prg;PRG;bit;BIT;m65;M65;sid;SID;bin;BIN" Me.AcceptFileDrop(FileType)

I also have tried it with the dot notation (.prg;.PRG…) but same result. While it’s working on Mac is there anything specific I have to do on the Windows side?

I also have created a FileGroup by the FileGroup editor and trying to access that one:

Me.AcceptFileDrop(FileTypeGroup1)

But I always got this error message on using a FileGroup (accessed by its ID):

MainWindow.Open, line 12
This item does not exist
Me.AcceptFileDrop(FileTypeGroup1.any)

MainWindow.Open, line 12
Parameter “type” expects type String, but this is type No Type.
Me.AcceptFileDrop(FileTypeGroup1)

This is weird because the documentation (Drag a File Onto a List Box → Step 4) is not using a string value at this stage.

Any ideas how I can solve the problem on Windows 10?

I guess I found the solution. If someone is interested in:

Me.AcceptFileDrop(FileTypeGroup1.All)

This accepts all files on Windows defined in FileType.

1 Like