Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Add Method, DataObjectFiles Object

Adds a filename to the DataObject.Files collection (sftCFFiles format only).

Syntax

VB.NETobject.Add(ByVal Filename As String, [ ByVal ItemIndex As Object ] )
VBobject.Add(ByVal Filename As String, [ ByVal ItemIndex As Variant ] )
C#.NETvoid object.Add(string Filename, object ItemIndex);
VC++HRESULT object->Add(_bstr_t Filename, const _variant_t& ItemIndex = vtMissing);
CHRESULT object->raw_Add(BSTR Filename, VARIANT ItemIndex);

object

A DataObjectFiles object.

Filename

The file name to be added to the collection.

ItemIndex

The one-based position where the file name is to be inserted. If ItemIndex is not specified, the new file name is added at the end of the collection.

Comments

The Add method adds a filename to the DataObject.Files collection (sftCFFiles format only).

The Files collection is filled with file names only when the DataObject object contains data of type sftCFFiles. The DataObject object can contain several different types of data. You can iterate through the collection to retrieve the list of file names.

Examples

VB.NET

Private Sub AxAxSftMask1_DragStarting(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_DragStartingEvent) Handles AxSftMask1.DragStarting
    If AxSftMask1.SelLength <> 0 Then
        AxSftMask1.OLEDrag()
    End If
End Sub

Private Sub AxAxSftMask1_OLEStartDrag(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_OLEStartDragEvent) Handles AxSftMask1.OLEStartDrag
    e.data.Clear()
    e.data.Files.Add(AxSftMask1.SelText)
    e.data.SetData(Nothing, SftOLEClipboardConstants.sftCFFiles)
    e.allowedEffects = 1 ' vbDropEffectCopy
End Sub

VB6

Private Sub SftMask1_DragStarting(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
    If SftMask1.SelLength <> 0 Then
        SftMask1.OLEDrag
    End If
End Sub

Private Sub SftMask1_OLEStartDrag(Data As SftMaskLib70.DataObject, AllowedEffects As Long)
    Data.Clear
    Data.Files.Add SftMask1.SelText
    Data.SetData , sftCFFiles
    AllowedEffects = vbDropEffectCopy
End Sub

C#

    if (axSftMask1.SelLength != 0) {
        axSftMask1.OLEDrag();
    }
}

private void axSftMask1_OLEStartDrag(object sender, AxSftMaskLib70._ISftMaskEvents_OLEStartDragEvent e)
{
    e.data.Clear();
    e.data.Files.Add(axSftMask1.SelText, null);
    e.data.SetData(null, SftOLEClipboardConstants.sftCFFiles);
    e.allowedEffects = 1; //vbDropEffectCopy
}

C++

        m_pMask1->OLEDrag();
    }
}

void CProject1Dlg::OnOLEStartDragSftMask1(LPDISPATCH FAR* Data, long FAR* AllowedEffects)
{
    IVDMDataObjectPtr pData = *Data;
    pData->Clear();
    pData->Files->Add(m_pMask1->SelText);
    pData->SetData(vtMissing, _variant_t((long) sftCFFiles));
    *AllowedEffects = DROPEFFECT_COPY;
}

BEGIN_EVENTSINK_MAP(CProject1Dlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CProject1Dlg)
    ON_EVENT(CProject1Dlg, IDC_SFTMASK1, 10 /* DragStarting */, OnDragStartingSftMask1, VTS_I2 VTS_I2 VTS_R4 VTS_R4)

See Also DataObjectFiles Object | Object Hierarchy


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