TMlSkinDragFile
A file drag-and-drop component (new in v5.x) that lets a form or a chosen control accept files dropped from Explorer.
Notes
BindingControlnames the control that accepts the drop; leave it empty to cover the whole form.- Dropping files fires
OnDragFiles, whose parameter carries the list of file names. - While a drag is over the target, a dashed highlight and a prompt are shown:
TipTextis the prompt, and the twoHighLightDotLine…Colorproperties are the normal and highlighted line colours.
Example
From the demo MlSkin.Demo.文件拖放.v5.x (.dfm form file)
object mlskndrgfl1: TMlSkinDragFile
BindingControl = shp1
OnDragFiles = mlskndrgfl1DragFiles
HighLightDotLineNormalColor = 1033457
HighLightDotLineHotColor = 7457839
TipText = 'Drag and drop files here'
TipFont.Charset = DEFAULT_CHARSET
TipFont.Color = 1033457
TipFont.Height = -27
TipFont.Name = 'Tahoma'
TipFont.Style = [fsBold]
Left = 408
Top = 248
end
Properties 5
| Name | Type | Default | Description |
|---|---|---|---|
BindingControl | TWinControl | — | The control that accepts dropped files; leave it empty to cover the whole form. |
HighLightDotLineNormalColor | TColor | $00A09FA1 | Colour of the dashed drop outline in its normal state. |
HighLightDotLineHotColor | TColor | $00CCBD43 | Colour of the dashed drop outline while files hover over the target. |
TipText | string | — | Prompt shown on the drop area, for example "Drop files here". |
TipFont | TFont | — | Font of the prompt. |
Events 3
| Name | Type | Default | Description |
|---|---|---|---|
OnDragEnter | TNotifyEvent | — | Fires when a drag enters the target. |
OnDragLeave | TNotifyEvent | — | Fires when a drag leaves the target. |
OnDragFiles | TDragFilesEvent | — | Fires when files are dropped; the handler receives the list of file names. |
Only the properties and events MLSkin adds are listed here. Standard VCL properties such as Align, Anchors, Font and OnClick are available too and behave exactly as on the stock controls.
Offline helpA PDF / CHM version is available for offline reading.