DragItem.AddItem

From Xojo Documentation

Method

DragItem.AddItem(Left as Integer, Top as Integer, Width as Integer, Height as Integer)

Supported for all project types and targets.

Adds an item to the drag object. The parameters specify the drag rectangle to be displayed.

Notes

This allows you do add additional items to the drag. After calling AddItem, you assign new values to all the DragItem properties for the newly added item. When the item is dropped, the NextItem method can be called to iterate through all the items in the DragItem.

Sample Code

Add two pictures to a DragItem:

Var d As DragItem
d = New DragItem(Self, X, Y, Me.Width, Me.Height)

d.DragPicture = MyDragPic
d.MouseCursor = System.Cursors.HandOpen
d.Picture = MyFirstPic
d.AddItem(0, 0, Me.Width, Me.Height)
d.Picture = MySecondPic

d.Drag // Allow the drag