Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

AutoRespond Property, SftTree Class

Defines whether the tree control automatically handles certain events to expand and collapse items or to resize columns.

Class: SftTree
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public bool AutoRespond { get; set; }
Public Property AutoRespond As Boolean

Value

True if the tree control automatically handles certain events, otherwise False.

The default value is True.

Comments

Defines whether the tree control automatically handles certain events to expand and collapse items or to resize columns.

If enabled, the tree control automatically expands/collapses items when the user double-clicks on an item and columns are resized when the user double-clicks in the column resizing area.

Examples

C#

        private void Form1_Load(object sender, EventArgs e) {
            sftTree1.Columns.Count = 2;
            sftTree1.Headers.Reorderable = sftTree1.Footers.Reorderable = false;
            sftTree1.Headers.MergeWithNextDefault = true;
            sftTree1.Headers.AllowMergeFromPreviousDefault = true;
            sftTree1.Columns[0].MergeWithNextDefault = true;
            sftTree1.Columns[1].AllowMergeFromPreviousDefault = true;
            sftTree1.MergeStyle = MergeStyleEnum.EmptyCells;
            sftTree1.AutoRespond = false;
            sftTree1.RowHeaders.Width = 0;
            LoadAssembly(Assembly.GetExecutingAssembly());
        }

        private void ExpandCollapseItem(ItemClass item)
        {
            if (item.Expanded)

VB.NET

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    sftTree1.Columns.Count = 2
    sftTree1.Headers.Reorderable = sftTree1.Footers.Reorderable = False
    sftTree1.Headers.MergeWithNextDefault = True
    sftTree1.Headers.AllowMergeFromPreviousDefault = True
    sftTree1.Columns(0).MergeWithNextDefault = True
    sftTree1.Columns(1).AllowMergeFromPreviousDefault = True
    sftTree1.MergeStyle = MergeStyleEnum.EmptyCells
    sftTree1.AutoRespond = False
    sftTree1.RowHeaders.Width = 0
    LoadAssembly(Assembly.GetExecutingAssembly())
End Sub

Private Sub ExpandCollapseItem(ByVal item As ItemClass)
    If item.Expanded Then
        item.Collapse(CollapseStyleEnum.SaveCurrent)

See Also SftTree Class | Classes | SftTree/NET 2.0