Control.Drag (gb.qt4)

Function Drag ( Data As Variant [ , Format As String ] ) As Control

Starts a drag & drop process.

  • Data is the data to be dragged. It can be a String or an Image.

  • If Data is a text, then you can specify in Format the MIME type of this text. For example, "text/html".

Warning...

Recommend to not use the Drag.Data property directly.

It can be a different format depending on the toolkit being used so you will have to process it according to how each toolkit sends it.

It is better to use the Drag.Paste() method.
eg..
Dim aFiles As String[] = Drag.Paste("text/uri-list")

Support for URIs

Since 3.18

If Format is "text/uri-list", then Data must be an array of file paths that will be sent to the clipboard as an URI list.


  Dim aPaths As New String[]
  aPaths.Add(User.Home &/ "File1.txt")
  aPaths.Add(User.Home &/ "File2.txt")
  aPaths.Add(User.Home &/ "File3.txt")

  MyControl.Drag(aPaths, "text/uri-list")

Warning

Many drag operations like a file drop may also contain other formats and Drag.Format can be an unexpected type. Use Drag.Formats.Exist() instead. See Drag.Format for a better explanation.

See also