HeaderPane
Main
Hide

SftTree/OCX 8.0 - ActiveX Tree Control

Share Link
Print

OLEDrag Method, SftTree Object

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 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

VB.NET

        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)

C#

            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) {

See Also SftTree Object | Object Hierarchy


Last Updated 05/24/2026 - (email)
© 2026 Softel vdm, Inc.