Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

Count Property, DataObjectFiles Object

Returns the number of filenames in the DataObject.Files collection (sftCFFiles format only).

Syntax

Get

VB.NETTotal = object.Count As Integer
VBTotal = object.Count As Long
C#.NETint Total = object.Count;
VC++long Total = object->Count;
long Total = object->GetCount();
CHRESULT object->get_Count(long* Total);

object

A DataObjectFiles object.

Total

Returns the number of filenames in the DataObject.Files collection (sftCFFiles format only).

Comments

The Count property returns the number of filenames in the DataObject.Files collection (sftCFFiles format only).

This property can be used to iterate through all file names in the DataObject.Files collection.

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 DataObjectFiles Object | Object Hierarchy


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