RectControl.AcceptFileDrop

From Xojo Documentation
Jump to: navigation, search
Method

RectControl.AcceptFileDrop(FileType as String)

Permits documents of type FileType to be dropped on the control.

FileType must be a file type that you defined in via the FileType class or the File Type Sets Editor.

Example

This code in the Open event of an ImageWell makes it possible for the user to drop either a picture or a file that is a jpeg image. The File Type Sets editor was used to define the “image/jpeg” file type. It is one of the “Common File Types” that is available in the editor.

me.AcceptPictureDrop
me.AcceptFileDrop("image/jpeg")

To restrict file drops to just folders (and not files), you can put this code in the DragEnter event:

If Not obj.FolderItem.Directory Then Return True
Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About