HeaderPane
Main
Hide
Share Link
Print

ExpandCollapseButton Property, ItemClass Class

Defines the expand/collapse button style.

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

Syntax

public ExpandCollapseButtonStyleEnum ExpandCollapseButton { get; set; }
Public Property ExpandCollapseButton As ExpandCollapseButtonStyleEnum

Value

The expand/collapse button.

The default value is ExpandCollapseButtonStyleEnum.Conditional.

Comments

Defines the expand/collapse button style.

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

Examples

C#

using Softelvdm.SftTreeNET;
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 ItemClass Class | Classes | SftTree/NET 3.0