Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

SftDirectory.OLEDragMode Property

Defines OLE drag support.

Syntax

Get

VB.NETMode = object.OLEDragMode As SftControlOLEDragModeConstants
VBMode = object.OLEDragMode As SftControlOLEDragModeConstants
C#.NETSftControlOLEDragModeConstants Mode = object.OLEDragMode;
VC++enum SftControlOLEDragModeConstants Mode = object->OLEDragMode;
enum SftControlOLEDragModeConstants Mode = object->GetOLEDragMode();
CHRESULT object->get_OLEDragMode(enum SftControlOLEDragModeConstants* Mode);

Put

VB.NETobject.OLEDragMode = Mode As SftControlOLEDragModeConstants
VBobject.OLEDragMode = Mode As SftControlOLEDragModeConstants
C#.NETSftControlOLEDragModeConstants object.OLEDragMode = Mode;
VC++enum SftControlOLEDragModeConstants object->OLEDragMode = Mode;
void object->PutOLEDragMode(enum SftControlOLEDragModeConstants Mode);
CHRESULT object->put_OLEDragMode(enum SftControlOLEDragModeConstants Mode);

object

A SftDirectory object.

Mode

Defines OLE drag support.

Comments

The OLEDragMode property defines OLE drag support.

OLE Drag & Drop is not supported with combo box style controls (see ControlStyle property).

Once an OLE drag & drop operation is started, the application receives the OLEStartDrag event, which is used to provide data to the DataObject.

If the OLEDragMode property is set to OLEDragSftControlManual, the application can start an OLE drag & drop operation in response to the DragStarting event or any other suitable event.

If the OLEDragMode property is set to OLEDragSftControlAutomatic, the control automatically initiates a drag & drop operation using the Windows Shell mechanisms.

Visual Basic: The DragMode property which is automatically added to the control by Visual Basic also affects the handling of a drag & drop operation. For OLE drag & drop to be available, Visual Basic's DragMode property must be set to vbManual. Please see the Visual Basic documentation for information about the DragMode property and its drag & drop support.

Examples

VB.NET

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AxSftDirectory1.OLEDragMode = SftControlOLEDragModeConstants.OLEDragSftControlManual
End Sub

Private Sub AxSftDirectory1_DragStarting(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_DragStartingEvent) Handles AxSftDirectory1.DragStarting
    Dim F As SftDirectoryFolder
    F = AxSftDirectory1.CurrentFolder
    If Not F Is Nothing Then
        AxSftDirectory1.OLEDrag(False, True, -1, -1)
    End If
End Sub

Private Sub AxSftDirectory1_OLEStartDrag(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_OLEStartDragEvent) Handles AxSftDirectory1.OLEStartDrag
    e.data.Clear()
    e.data.SetData(Nothing, SftOLEClipboardConstants.sftCFText)
    e.allowedEffects = 1 'vbDropEffectCopy

VB6

Private Sub Form_Load()
    SftDirectory1.OLEDragMode = OLEDragSftControlManual
End Sub

Private Sub SftDirectory1_DragStarting(ByVal Button As Integer, ByVal Shift As Integer, _
        ByVal xPos As Single, ByVal yPos As Single)
    Dim F As SftDirectoryFolder
    Set F = SftDirectory1.CurrentFolder
    If Not F Is Nothing Then
        SftDirectory1.OLEDrag False, True, -1, -1
    End If
End Sub

Private Sub SftDirectory1_OLEStartDrag(Data As SftDirectoryLib30.DataObject, _
        AllowedEffects As Long)
    Data.Clear

C#

private void Form1_Load(object sender, System.EventArgs e)
{
    axSftDirectory1.OLEDragMode = SftControlOLEDragModeConstants.OLEDragSftControlManual;
}

private void axSftDirectory1_DragStarting(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_DragStartingEvent e)
{
    SftDirectoryFolder f;
    f = axSftDirectory1.CurrentFolder;
    if (f != null) {
        axSftDirectory1.OLEDrag(false, true, -1, -1);
    }
}

private void axSftDirectory1_OLEStartDrag(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_OLEStartDragEvent e)
{

C++

{
    CDialog::OnInitDialog();

    SetIcon(m_hIcon, TRUE);            // Set big icon
    SetIcon(m_hIcon, FALSE);        // Set small icon

    m_vDir1 = m_Dir1.GetControlUnknown();

    m_vDir1->OLEDragMode = OLEDragSftControlManual;

    return TRUE;
}

void COLEDragDlg::OnDragStartingSftDirectory1(short Button, short Shift, long xPos, long yPos)
{
    ISftDirectoryFolderPtr pFolder;

See Also SftDirectory Object | Object Hierarchy


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