Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

Item Property, DataObjectFiles Object

Returns a specific filename by index from the DataObject.Files collection (sftCFFiles format only).

Syntax

Get

VB.NETItem = object.Item(ByVal ItemIndex As Integer) As String
VBItem = object.Item(ByVal ItemIndex As Long) As String
C#.NETstring Item = object[int ItemIndex];
VC++_bstr_t Item = object->Item[long ItemIndex];
_bstr_t Item = object->GetItem(long ItemIndex);
CHRESULT object->get_Item(long ItemIndex, BSTR* Item);

object

A DataObjectFiles object.

ItemIndex

The one-based position of the file name to be retrieved.

Item

Returns a specific filename by index from the DataObject.Files collection (sftCFFiles format only).

Comments

The Item property returns a specific filename by index from the DataObject.Files collection (sftCFFiles format only).

Examples

VB6

    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
    ' setting, but never smaller

C++

        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
    // setting, but never smaller

See Also DataObjectFiles 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.