Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

ExpandCollapseButtonStyleEnum Enumeration

Used with the ItemClass.ExpandCollapseButton property to define the expand/collapse button style.

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

Syntax

public enum ExpandCollapseButtonStyleEnum;
Public Enum ExpandCollapseButtonStyleEnum

Values

NameDescription
ConditionalThe expand/collapse button is only shown if the item has dependents.
ShowThe expand/collapse button is always shown even if the item does not have dependents. An application can dynamically add dependents when the ItemClick event occurs.
HideNever show the expand/collapse button even if the item has dependents.

Comments

Used with the ItemClass.ExpandCollapseButton property to define the expand/collapse button style.

Examples

C#

using Softelvdm.Controls;

namespace ExploreAssembly
{
    public partial class Form1 : Form
    {
        // This example implements dynamically populating the tree control ("load as you go").
        // As items are added, they are marked as expandable (ExpandCollapseButton =
        // ExpandCollapseButtonStyleEnum.Show, even though no child items are added (yet).
        // Once the user clicks on the expand/collapse button, the child items are added.
        // The data displayed is created by loading an assembly and displaying defined
        // types.
        public Form1()
        {
            InitializeComponent();
        }

VB.NET

    LoadAssembly(asm)
End Sub

Private Sub ListInfo(ByVal itemCollection As ItemCollectionClass, ByVal a As Assembly)

    Dim item As ItemClass = itemCollection.Add("Custom Attributes")
    item.TagObjects = a.GetCustomAttributes(True)
    If item.TagObjects.Length > 0 Then
        item.ExpandCollapseButton = ExpandCollapseButtonStyleEnum.Show
    Else
        item.ExpandCollapseButton = ExpandCollapseButtonStyleEnum.Hide
    End If

    item = itemCollection.Add("Exported Types")
    item.TagObjects = a.GetExportedTypes()
    If item.TagObjects.Length > 0 Then

See Also | Classes | SftTree/NET 2.0



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.