HeaderPane
Main
Hide

SftTree/OCX 8.0 - ActiveX Tree Control

Share Link
Print

Collapse Method, SftTreeItem Object

Collapses the item so its dependents are no longer visible.

Syntax

VB.NETobject.Collapse(ByVal Preserve As Boolean)
VBobject.Collapse(ByVal Preserve As Boolean)
C#.NETvoid object.Collapse(bool Preserve);
VC++HRESULT object->Collapse(VARIANT_BOOL Preserve);
CHRESULT object->raw_Collapse(VARIANT_BOOL Preserve);

object

A SftTreeItem object.

Preserve

Defines whether the expand/collapse state is preserved.

PreserveDescription
TruePreserves the expand/collapse state of dependent items that are made no longer visible. A subsequent call to Items.Expand or Item.Expand will restore the items with the remembered expand/collapse state.
FalseThe expand/collapse state is not preserved.

Comments

The Collapse method collapses the item so its dependents are no longer visible.

The Collapse method collapses all dependent items of the item and saves the expand/collapse state of all dependent items, so it can be restored by a subsequent Items.Expand or Item.Expand method call.

If a parent item is collapsed, subsequently adding child items will automatically expand the item.

See Also SftTreeItem Object | Object Hierarchy


Last Updated 05/24/2026 - (email)
© 2026 Softel vdm, Inc.