Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBox.OLEDrag Method

Initiates an OLE drag & drop operation.

Syntax

VB.NETobject.OLEDrag()
VBobject.OLEDrag
C#.NETvoid object.OLEDrag();
VC++HRESULT object->OLEDrag();
CHRESULT object->raw_OLEDrag();

object

A SftBox object.

Comments

The OLEDrag method initiates an OLE drag & drop operation.

When the OLEDrag method is called, the OLEStartDrag event occurs, allowing the application to supply data to a target component.

An application can invoke an OLE drag & drop operation explicitly using the OLEDrag method.

If the OLEDragMode property is set to OLEDragSftBoxAutomatic, the OLEDrag method is automatically invoked when an OLE drag & drop operation is started by the user.

Examples

VB.NET

    comboTarget.Items.Add("Another Source Item")
    comboTarget.Items.Add("Last Source Item")
    comboTarget.Columns.MakeOptimal(0)
    comboTarget.Items.RecalcHorizontalExtent(0)

End Sub

Private Sub comboSource_DragStarting(ByVal sender As Object, ByVal e As AxSftBoxLib50._ISftBoxEvents_DragStartingEvent) Handles comboSource.DragStarting
    comboSource.OLEDrag()
End Sub

Private Sub comboSource_OLEStartDrag(ByVal sender As Object, ByVal e As AxSftBoxLib50._ISftBoxEvents_OLEStartDragEvent) Handles comboSource.OLEStartDrag
    e.allowedEffects = vbDropEffectCopy Or vbDropEffectMove
    Dim textData As String = comboSource.get_Cell(comboSource.Items.Selection, 0).Text
    e.data.SetData(textData, SftOLEClipboardConstants.sftCFText)
End Sub

VB6

        Next
        ComboTarget.Items.Selection = ItemIndex
    End If
    ComboTarget.Columns.MakeOptimal 0
    ComboTarget.Items.RecalcHorizontalExtent 0
End Sub

Private Sub ComboSource_DragStarting(ByVal Part As SftBoxLib50.SftBoxPortionConstants, ByVal Button As Integer, ByVal Shift As Integer, ByVal xPos As Single, ByVal yPos As Single)
    ComboSource.OLEDrag
End Sub

Private Sub ComboSource_OLEStartDrag(Data As SftBoxLib50.DataObject, AllowedEffects As Long)
    AllowedEffects = vbDropEffectCopy Or vbDropEffectMove
    Data.SetData ComboSource.Cell(ComboSource.Items.Selection, 0).Text, sftCFText
End Sub

C#

    comboTarget.Items.Add("Another Source Item");
    comboTarget.Items.Add("Last Source Item");
    comboTarget.Columns.MakeOptimal(0);
    comboTarget.Items.RecalcHorizontalExtent(0);
}

private void comboSource_DragStarting(object sender, AxSftBoxLib50._ISftBoxEvents_DragStartingEvent e)
{
    comboSource.OLEDrag();
}

private void comboSource_OLEStartDrag(object sender, AxSftBoxLib50._ISftBoxEvents_OLEStartDragEvent e)
{
    e.allowedEffects = vbDropEffectCopy | vbDropEffectMove;
    string textData = comboSource.get_Cell(comboSource.Items.Selection, 0).Text;
    e.data.SetData(textData, SftOLEClipboardConstants.sftCFText);

See Also SftBox Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.