HeaderPane
Main
Hide
Share Link
Print

OLEDrag Method, SftBox Object

Initiates an OLE drag & drop operation.

Syntax

C#void object.OLEDrag();
VB.NETobject.OLEDrag()
C++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

C# View entire sample code

            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, AxSftBoxLib60._ISftBoxEvents_DragStartingEvent e)
        {
            comboSource.OLEDrag();
        }

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

VB.NET View entire sample code

    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 AxSftBoxLib60._ISftBoxEvents_DragStartingEvent) Handles comboSource.DragStarting
    comboSource.OLEDrag()
End Sub

Private Sub comboSource_OLEStartDrag(ByVal sender As Object, ByVal e As AxSftBoxLib60._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

See Also SftBox Object | Object Hierarchy


Last Updated 11/22/2026 - (email)
© 2026 Softel vdm, Inc.