Collapse Method (TreeView)

Class

TreeView.

Action

Collapse an item in a treeview control.

Syntax

treeview.Collapse(Item)
Variable Description
Item The item to collapse. STRING or INTEGER.

Notes

Collapse collapses the specified treeview item if it is currently expanded (that is, has visible children).

  • If the item has an expand/collapse box (typically a + or - sign), Silk Test Classic collapses the item by clicking on this box.
  • Otherwise, if the treeview supports the use of double-click to expand and collapse items, Silk Test Classic double-clicks on the item.
  • If neither approach is supported by the control, or if the specified item is not collapsible (that is, has no children), an error is raised.

For information on specifying Item, see the TreeView class.

See the UseExpandButton option for more information about how Silk Test Classic expands and collapses nodes in a JavaJFCTreeView in the Java extension.

Example

MyDialog.MyTreeView.Collapse("/root/child/grandchild")