Fired when the user drops files dragged from Windows Explorer.

Parameters

ParameterDescription
CountThe number of files dropped
FileListList of files dropped

Remarks

The OnFileDrop event is fired whenever the user drags files from Windows Explorer and drops them over a picture control. The first parameter is the number of files dropped and the second parameter is a list of those files, but the list does not use standard OI delimiters. This is due to a limitation in OI in which field marks and record marks cannot be passed through OLE event parameters.

Each file is separated by a pipe '|' character. Furthermore, each file is a two part key separated by an asterisk '*' character. The first part is the file path and name and the second part is a boolean flag indicating whether or not the file is a recognized image file. If it is, then this flag is 1. If the flag is 0, then the file is either an unrecognized image format or not an image at all.

In most cases, it is easiest to convert pipes and asterisks into @FM and @VM respectively.

Once you've capture this event, you can do what you want with the file list. You may even update the picture's Image property with any of the recognized image files dropped. For your convenience, you can have the picture control automatically update it's image by using the AutoLoadDropFile property.

Example

Transfer Param1 to FileCount 
Transfer Param2 to FileList 

Convert "|*" to @FM:@VM in FileList 

// TODO: Process files here.

See Also

AutoLoadDropFileImage

  • No labels