Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

ExpandStyleEnum Enumeration

Used with the Expand method.

Class: (none)
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public enum ExpandStyleEnum;
Public Enum ExpandStyleEnum

Values

NameDescription
AllExpand all dependent items, including indirect dependent items resulting in all dependents fully expanded.
DirectOnlyExpand this item, collapse all its dependents.
SimpleExpand this item, leave its dependents unchanged.
RestoreLastExpand this item and restore all its dependents to their last saved state.

Comments

Used with the Expand method.

Examples

C#

        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 {
                // selected an item
            }
        }

VB.NET

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
        ' selected an item
    End If
End Sub

See Also | Classes | SftTree/NET 2.0