HeaderPane
Main
Hide
Share Link
Print

OLEDrag Method, SftTree Object

Initiates an OLE drag & drop operation.

Syntax

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

object

A SftTree 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 DragMethod property is set to dragSftTreeOLE, the OLEDrag method is automatically invoked when a drag & drop operation is started by the user, depending on the DragType property.

Examples

C# View entire sample code

            Image sendingImage = OLECvt.ToImage(img.Picture);
            data.SetData(DataFormats.Bitmap, true, sendingImage);
            DoDragDrop(data, DragDropEffects.Copy);
        }

        private void axSftTree1_OLEStartDrag(object sender, AxSftTreeLib80._DSftTreeEvents_OLEStartDragEvent e) {

            // This section demonstrates drag&drop) using OLE mechanisms built into this control
            // THIS CODE IS ONLY USED IF DRAGMETHOD IS SET TO  ( 3 - OLEDrag ) or SftTreeDragMethodConstants.dragSftTreeOLE

            int curr = axSftTree1.Items.Current;
            // cell text
            e.data.SetData(axSftTree1.get_Cell(curr, 0).Text, SftOLEClipboardConstants.sftCFText);
            // item picture
            SftPictureObject img = null;
            if (axSftTree1.get_Item(curr).Image.Type == SftPictureTypeConstants.sftTypeIDispatch) {

VB.NET View entire sample code

        Dim sendingImage As Image = OLECvt.ToImage(img.Picture)
        Data.SetData(DataFormats.Bitmap, True, sendingImage)
        DoDragDrop(Data, DragDropEffects.Copy)
    End Sub

    Private Sub AxSftTree1_OLEStartDrag(ByVal sender As Object, ByVal e As AxSftTreeLib80._DSftTreeEvents_OLEStartDragEvent) Handles AxSftTree1.OLEStartDrag

        ' This section demonstrates drag&drop) using OLE mechanisms built into this control
        ' THIS CODE IS ONLY USED IF DRAGMETHOD IS SET TO  ( 3 - OLEDrag ) or SftTreeDragMethodConstants.dragSftTreeOLE

        Dim curr As Integer
        curr = AxSftTree1.Items.Current

        ' cell text
        e.data.SetData(AxSftTree1.get_Cell(curr, 0).Text, SftOLEClipboardConstants.sftCFText)

See Also SftTree Object | Object Hierarchy


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