Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

Files Property, DataObject Object

Returns a collection of filenames used by the sftCFFiles format.

Syntax

Get

VB.NETFiles = object.Files As DataObjectFiles
VBSet Files = object.Files As DataObjectFiles
C#.NETDataObjectFiles Files = object.Files;
VC++IVDMDataObjectFiles* Files = object->Files;
IVDMDataObjectFiles* Files = object->GetFiles();
CHRESULT object->get_Files(struct IVDMDataObjectFiles** Files);

object

A DataObject object.

Files

A collection of filenames used by the sftCFFiles format.

Comments

The Files property returns a collection of filenames used by the sftCFFiles format.

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 Files collection using the DataObjectFiles.Item property to retrieve the list of file names.

The Files collection can be filled to allow an application to act as a drag source for a list of files (similar to Windows Explorer).

Examples

VB.NET

        End If
        If e.data.GetFormat(SftOLEClipboardConstants.sftCFFiles) Then
            AxSftTree1.BulkUpdate = True
            Dim lvl As Integer
            lvl = AxSftTree1.get_Item(insertAt).Level
            Dim newItem As Integer
            newItem = insertAt + 1
            Dim i As Integer
            For i = e.data.Files.Count To 1 Step -1
                newItem = AxSftTree1.Items.Insert(newItem, e.data.Files(i))
                AxSftTree1.get_Item(newItem).Level = lvl + 1
            Next
            AxSftTree1.BulkUpdate = False
        End If

        ' make horizontal extent and width of column 0 wider than previous

VB6

        SftTree1.Item(newItem).Level = lvl + 1
    ElseIf Data.GetFormat(vbCFDIB) Then
        Set SftTree1.Cell(insertAt, 0).Image.Picture = Data.GetData(vbCFDIB)
        SftTree1.Cell(insertAt, 0).ImageHAlign = halignSftTreeRight
    ElseIf Data.GetFormat(vbCFFiles) Then
        SftTree1.BulkUpdate = True
        lvl = SftTree1.Item(insertAt).Level
        newItem = insertAt + 1
        For i = Data.Files.Count To 1 Step -1
            newItem = SftTree1.Items.Insert(newItem, Data.Files.Item(i))
            SftTree1.Item(newItem).Level = lvl + 1
        Next
        SftTree1.BulkUpdate = False
    End If

    ' make horizontal extent and width of column 0 wider than previous

C#

            if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFBitmap)) {
                axSftTree1.get_Cell(insertAt, 0).Image.Picture = (stdole.IPictureDisp)e.data.GetData((short) SftOLEClipboardConstants.sftCFBitmap);
                axSftTree1.get_Cell(insertAt, 0).ImageHAlign = SftTreeHAlignConstants.halignSftTreeRight;
            }
            if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFFiles)) {
                axSftTree1.BulkUpdate = true;
                short lvl = axSftTree1.get_Item(insertAt).Level;
                int newItem = insertAt + 1;
                for (int i = e.data.Files.Count ; i >= 1 ; --i) {
                    newItem = axSftTree1.Items.Insert(newItem, e.data.Files[i]);
                    axSftTree1.get_Item(newItem).Level = (short) (lvl + 1);
                }
                axSftTree1.BulkUpdate = false;
            }

            // make horizontal extent and width of column 0 wider than previous

C++

        _variant_t object = pDataObject->GetData((short)sftCFDIB);
        IPictureDispPtr pPicDisp = object;
        m_vTree->Cell[insertAt][0]->Image->PutRefPicture(pPicDisp);
        m_vTree->Cell[insertAt][0]->ImageHAlign = halignSftTreeRight;
    } else if (pDataObject->GetFormat(sftCFFiles)) {
        m_vTree->BulkUpdate = VARIANT_TRUE;
        int lvl = m_vTree->Item[insertAt]->Level;
        long newItem = insertAt + 1;
        for (int i = pDataObject->Files->Count ; i >= 1 ; --i) {
            newItem = m_vTree->Items->Insert(newItem, pDataObject->Files->GetItem(i));
            m_vTree->Item[newItem]->Level = lvl + 1;
        }
        m_vTree->BulkUpdate = VARIANT_FALSE;
    }

    // make horizontal extent and width of column 0 wider than previous

See Also DataObject Object | Object Hierarchy


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


Spring Break!

Our offices will be closed this week (March 18 through March 22).

We'll be back March 24 to address any pending sales and support issues.