SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines the drop target item.
Get
VB.NET | ItemIndex = object.DropIndex As Integer |
VB | ItemIndex = object.DropIndex As Long |
C#.NET | int ItemIndex = object.DropIndex; |
VC++ | long ItemIndex = object->DropIndex; long ItemIndex = object->GetDropIndex(); |
C | HRESULT object->get_DropIndex(long* ItemIndex); |
Put
VB.NET | object.DropIndex = ItemIndex As Integer |
VB | object.DropIndex = ItemIndex As Long |
C#.NET | int object.DropIndex = ItemIndex; |
VC++ | long object->DropIndex = ItemIndex; void object->PutDropIndex(long ItemIndex); |
C | HRESULT object->put_DropIndex(long ItemIndex); |
object
ItemIndex
The zero-based index of the item which acts as the current drop target.
The DropIndex property defines the drop target item.
The DropIndex property is typically used in the OLEDragDrop event to determine where data has been dropped, i.e. which item within the control is the drop target. The value of the DropIndex property is determined by the TargetIndex parameter of the OLEDragOver event.
The DropIndex property is used to highlight the target of a drag & drop operation. There can be only one drop target at any one time. By setting the DropIndex property to a new item, the previous item is no longer a drop target and is no longer highlighted.
The Items.DropHighlightStyle property can be used to control the appearance of the target item. Depending on the Items.DropHighlightStyle property value, the ItemIndex specified is the actual drop target or the insertion point. If used as an insertion point, the ItemIndex value can be set to the number of items in the control, which moves the insertion point to the end of the list of items.
By setting the DropIndex property to -1, the current drop target is cleared.
Based on the Items.DropScrolling property, if the DropIndex property is set to the first (or last) item currently visible in the drop down portion, the control automatically scrolls up (or down) one item. This allows a user to drag items to a target item which has to be scrolled into view first. The contents of the control will scroll in the given direction until the DropIndex property is set to -1 or to the index of an item which is not the first (or last) item visible.
If the DropIndex property is set to -1, the Items.DropScrolling property is automatically set to False.
' user is moving from/to the static or drop down portion comboTarget.DropDown.RollUp(500) ' 1/2 second End If End Sub Private Sub comboTarget_OLEDragDrop(ByVal sender As Object, ByVal e As AxSftBoxLib50._ISftBoxEvents_OLEDragDropEvent) Handles comboTarget.OLEDragDrop If e.data.GetFormat(SftOLEClipboardConstants.sftCFText) Then Dim itemIndex As Integer itemIndex = comboTarget.Items.Insert(e.data.GetData(SftOLEClipboardConstants.sftCFText), comboTarget.Items.DropIndex) comboTarget.Items.Selection = itemIndex End If If e.data.GetFormat(SftOLEClipboardConstants.sftCFBitmap) Then Dim itemIndex As Integer itemIndex = comboTarget.Items.Insert("A Bitmap", comboTarget.Items.DropIndex) Dim o As Object = e.data.GetData(SftOLEClipboardConstants.sftCFBitmap) comboTarget.get_Item(itemIndex).Image.Picture = o 'as stdole.IPictureDisp
' user is moving from/to the static or drop down portion ComboTarget.DropDown.RollUp 500 ' 1/2 second End If End Sub Private Sub ComboTarget_OLEDragDrop(Data As SftBoxLib50.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) Dim ItemIndex As Long If Data.GetFormat(sftCFText) Then ItemIndex = ComboTarget.Items.Insert(Data.GetData(sftCFText), ComboTarget.Items.DropIndex) ComboTarget.Items.Selection = ItemIndex End If If Data.GetFormat(sftCFDIB) Then ItemIndex = ComboTarget.Items.Insert("A Bitmap", ComboTarget.Items.DropIndex) Set ComboTarget.Item(ItemIndex).Image.Picture = Data.GetData(sftCFDIB) ComboTarget.Items.Selection = ItemIndex End If
// user is moving from/to the static or drop down portion comboTarget.DropDown.RollUp(500); // 1/2 second } } private void comboTarget_OLEDragDrop(object sender, AxSftBoxLib50._ISftBoxEvents_OLEDragDropEvent e) { if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFText)) { int itemIndex = comboTarget.Items.Insert(e.data.GetData(SftOLEClipboardConstants.sftCFText) as string, comboTarget.Items.DropIndex); comboTarget.Items.Selection = itemIndex; } if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFBitmap)) { int itemIndex = comboTarget.Items.Insert("A Bitmap", comboTarget.Items.DropIndex); object o = e.data.GetData(SftOLEClipboardConstants.sftCFBitmap); comboTarget.get_Item(itemIndex).Image.Picture = o as stdole.IPictureDisp; comboTarget.Items.Selection = itemIndex;
See Also SftBoxItems Object | Object Hierarchy