Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Collapse Method, ItemClass Class

Collapses the item so its dependents are hidden.

Class: ItemClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public void Collapse( CollapseStyleEnum Style );
Public Sub Collapse( ByVal Style As CollapseStyleEnum )

Parameters

Style

Defines how the item and its dependents are collapsed.

Comments

Collapses the item so its dependents are hidden.

This method can only be used for items in the item area.

Examples

C#

            item.TagString = "This is a tooltip for an item labeled " + ItemText;
        }

        private void ClickCategory(ItemClass item)
        {
            if (item.Level == 0) {
                bool fWasExpanded = item.Expanded;
                if (fWasExpanded) {
                    item.Collapse(CollapseStyleEnum.All);
                    item.Cells[0].Image = m_PlusImage;
                } else {
                    item.Expand(ExpandStyleEnum.All);
                    item.Cells[0].Image = m_MinusImage;
                }
                item.ScrollIntoView();
            } else {

VB.NET

    cell.Parts.Add(New TextPartClass(ItemText))
    item.TagString = "This is a tooltip for an item labeled " & ItemText
End Sub

Private Sub ClickCategory(ByVal item As ItemClass)
    If item.Level = 0 Then
        Dim fWasExpanded As Boolean = item.Expanded
        If fWasExpanded Then
            item.Collapse(CollapseStyleEnum.All)
            item.Cells(0).Image = m_PlusImage
        Else
            item.Expand(ExpandStyleEnum.All)
            item.Cells(0).Image = m_MinusImage
        End If
        item.ScrollIntoView()
    Else

See Also ItemClass Class | Classes | SftTree/NET 2.0