DragItem.AddItem

From Real Software Documentation

Jump to: navigation, search
Method
DragItem.AddItem ( Left as Integer, Top as Integer, Width as Integer, Height as Integer )

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


Example

This example is from the ListBoxes example that is in the Exammples folder that ships with Real Studio. The project demonstrates how to drag one or more rows from one ListBox to another. If more than one row has been selected for the drag, the DragRow event handler uses AddItem in a loop until all the row have been added.

#pragma unused row

Dim nRows, i as Integer
nRows=Me.ListCount-1
For i=0 to nRows
If Me.Selected(i) then
Drag.AddItem(0,0,20,4)
Drag.Text=Me.List(i) //get text
End if
Next
Return True //allow the drag
Personal tools