# Drag & drop folder work on any Window 10 control?

**URL:** <https://forum.xojo.com/t/drag-drop-folder-work-on-any-window-10-control/84789>\
**Category:** Windows\
**Created:** [March 29, 2025, 4:17pm UTC](https://forum.xojo.com/t/drag-drop-folder-work-on-any-window-10-control/84789 "2025-03-29T16:17:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![C\_T\_Baumgartner](https://forum.xojo.com/user_avatar/forum.xojo.com/c_t_baumgartner/32/780_2.png) [@C\_T\_Baumgartner](https://forum.xojo.com/u/C_T_Baumgartner)\
**Post date:** [March 29, 2025, 4:17pm UTC](https://forum.xojo.com/t/drag-drop-folder-work-on-any-window-10-control/84789/1 "2025-03-29T16:17:36Z")

</div>

I want to drag and drop a folder on a textfield and display the path in the textfield. This works perfectly in MacOS. Doesn’t work in Windows 10. I could drag to some other control so tried using a Canvas. I did check that the IDE has Windows Security Privileges set to User.

---

<div class="post-metadata">

**Author:** ![C\_T\_Baumgartner](https://forum.xojo.com/user_avatar/forum.xojo.com/c_t_baumgartner/32/780_2.png) [@C\_T\_Baumgartner](https://forum.xojo.com/u/C_T_Baumgartner)\
**Post date:** [March 29, 2025, 4:20pm UTC](https://forum.xojo.com/t/drag-drop-folder-work-on-any-window-10-control/84789/2 "2025-03-29T16:20:34Z")

</div>

Fixed. Changed me.AcceptFileDrop(“text”) to me.AcceptFileDrop(“???”) [four question marks]

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [March 30, 2025, 1:02am UTC](https://forum.xojo.com/t/drag-drop-folder-work-on-any-window-10-control/84789/3 "2025-03-30T01:02:21Z")

</div>

> [@C\_T\_Baumgartner](#):
>
> AcceptFileDrop

If it’s OK for you…

But the documentation states:  
 ![image](https://forum.xojo.com/uploads/default/original/3X/f/9/f92c9f0774da1bc2c5bfb2fcc7249b9980d02797.png)

**AcceptFileDrop** (FileType As [String](https://documentation.xojo.com/api/data_types/string.html))

> Permits documents of type _FileType_ to be dropped on the control. _FileType_ must be a file type that you defined in via the [FileType](https://documentation.xojo.com/api/files/filetype.html) class or the File Type Sets Editor.

Alternatively, you can use a FileType:

```auto
Var txtType As New FileType
txtTypeName = "text/raw"
txtType.Extensions = "txt"

```

or

```auto
Var htmlType As New FileType
htmlType.Name = "text/html"
htmlType.Extensions = "htm;html"

```

and so on for csv, json, etc.

And you can combine two or more in `me.AcceptFileDrop()`

Using “???” allows your users to drop an image file.

Doh ! You says you want to drop a folder… you have to find the correct name (“os/folder” ?) and test if nothing as extension works.

If you add a FileTypeGroup, drop a Folder from the Finder to fill the properties. This advice comes from Greg.

Here lies the documentation (for FileType, but not only

---

<div class="post-metadata">

**Author:** ![C\_T\_Baumgartner](https://forum.xojo.com/user_avatar/forum.xojo.com/c_t_baumgartner/32/780_2.png) [@C\_T\_Baumgartner](https://forum.xojo.com/u/C_T_Baumgartner)\
**Post date:** [March 30, 2025, 12:06pm UTC](https://forum.xojo.com/t/drag-drop-folder-work-on-any-window-10-control/84789/4 "2025-03-30T12:06:42Z")

</div>

The following code (from another forum post) in DragEnter event ensures that only a folder item is accepted.

If Not obj.FolderItem.IsFolder Then Return True

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [March 30, 2025, 12:36pm UTC](https://forum.xojo.com/t/drag-drop-folder-work-on-any-window-10-control/84789/5 "2025-03-30T12:36:13Z")

</div>

That is good ! I forgot about it.

But the UI feedback is different: with “???” the OS inform you the drop is allowed. If you set valid file extension / file type, the OS inform you (with a No Drop) the drop is not possible.

The trick line (below) allows you to exclude dealing with the droped object. But the object HAVE BEEN ACCEPTED.

`If Not obj.FolderItem.IsFolder Then Return True`
