TMlSkinDragFile

A file drag-and-drop component (new in v5.x) that lets a form or a chosen control accept files dropped from Explorer.

Category
Dialogs & misc
Unit
uMlSkinDragFiles.pas
Inherits from
TComponent

Notes

  • BindingControl names 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: TipText is the prompt, and the two HighLightDotLine…Color properties 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

NameTypeDefaultDescription
BindingControlTWinControlThe control that accepts dropped files; leave it empty to cover the whole form.
HighLightDotLineNormalColorTColor$00A09FA1Colour of the dashed drop outline in its normal state.
HighLightDotLineHotColorTColor$00CCBD43Colour of the dashed drop outline while files hover over the target.
TipTextstringPrompt shown on the drop area, for example "Drop files here".
TipFontTFontFont of the prompt.

Events 3

NameTypeDefaultDescription
OnDragEnterTNotifyEventFires when a drag enters the target.
OnDragLeaveTNotifyEventFires when a drag leaves the target.
OnDragFilesTDragFilesEventFires 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.