Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

DependentAllCount Property, SftTreeItem Object

Returns the item's number of all dependents.

Syntax

Get

VB.NETCount = object.DependentAllCount As Integer
VBCount = object.DependentAllCount As Long
C#.NETint Count = object.DependentAllCount;
VC++long Count = object->DependentAllCount;
long Count = object->GetDependentAllCount();
CHRESULT object->get_DependentAllCount(long* Count);

object

A SftTreeItem object.

Count

Returns the item's number of all dependents, including immediate and indirect dependents.

Comments

The DependentAllCount property returns the item's number of all dependents.

The Item.DependentCount property can be used to determine the item's number of immediate dependents.

Examples

VB.NET

        ' item picture
        Dim img As SftPictureObject
        If AxSftTree1.get_Item(curr).Image.Type = SftPictureTypeConstants.sftTypeIDispatch Then
            img = AxSftTree1.get_Item(curr).Image
        Else
            If AxSftTree1.get_Item(curr).Expanded Then
                img = AxSftTree1.Items.ItemImageExpanded
            ElseIf AxSftTree1.get_Item(curr).DependentAllCount > 0 Then
                img = AxSftTree1.Items.ItemImageExpandable
            Else
                img = AxSftTree1.Items.ItemImageLeaf
            End If
        End If
        Dim sendingImage As Image = OLECvt.ToImage(img.Picture)
        Data.SetData(DataFormats.Bitmap, True, sendingImage)
        DoDragDrop(Data, DragDropEffects.Copy)

VB6

    ' cell text
    Data.SetData SftTree1.Cell(curr, 0).Text, vbCFText
    ' item picture
    If SftTree1.Item(curr).Image.Type = sftTypeIDispatch Then
        Data.SetData SftTree1.Item(curr).Image.Picture, vbCFDIB
    Else
        If SftTree1.Item(curr).Expanded Then
            Data.SetData SftTree1.Items.ItemImageExpanded.Picture, vbCFDIB
        ElseIf SftTree1.Item(curr).DependentAllCount > 0 Then
            Data.SetData SftTree1.Items.ItemImageExpandable.Picture, vbCFDIB
        Else
            Data.SetData SftTree1.Items.ItemImageLeaf.Picture, vbCFDIB
        End If
    End If
End Sub

C#

            // item picture
            SftPictureObject img = null;
            if (axSftTree1.get_Item(curr).Image.Type == SftPictureTypeConstants.sftTypeIDispatch) {
                img = axSftTree1.get_Item(curr).Image;
            } else {
                if (axSftTree1.get_Item(curr).Expanded)
                    img = axSftTree1.Items.ItemImageExpanded;
                else if (axSftTree1.get_Item(curr).DependentAllCount > 0)
                    img = axSftTree1.Items.ItemImageExpandable;
                else
                    img = axSftTree1.Items.ItemImageLeaf;
            }
            Image sendingImage = OLECvt.ToImage(img.Picture);
            data.SetData(DataFormats.Bitmap, true, sendingImage);
            DoDragDrop(data, DragDropEffects.Copy);
        }

C++

    // cell text
    pDataObject->SetData(_variant_t(m_vTree->Cell[curr][0]->Text), _variant_t((short)sftCFText));
    // item picture
    if (m_vTree->Item[curr]->Image->Type == sftTypeIDispatch) {
        pDataObject->SetData(_variant_t(m_vTree->Item[curr]->Image->GetPicture(), _variant_t((short)sftCFDIB)));
    } else {
        if (m_vTree->Item[curr]->Expanded != VARIANT_FALSE)
            pDataObject->SetData(_variant_t(m_vTree->Items->ItemImageExpanded->GetPicture(), _variant_t((short)sftCFDIB)));
        else if (m_vTree->Item[curr]->DependentAllCount > 0)
            pDataObject->SetData(_variant_t(m_vTree->Items->ItemImageExpandable->GetPicture(), _variant_t((short)sftCFDIB)));
        else
            pDataObject->SetData(_variant_t(m_vTree->Items->ItemImageLeaf->GetPicture(), _variant_t((short)sftCFDIB)));
    }
}

void CDragDropDlg::OnOLEDragDropSftTree(LPDISPATCH FAR* Data, long FAR* Effect, short FAR* Button, short FAR* Shift, float FAR* x, float FAR* y)

See Also SftTreeItem Object | Object Hierarchy


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