property Items.ExpandItem(Item as HITEM) as Boolean

Expands, or collapses, the child items of the specified item.

TypeDescription
Item as HITEM A long expression that indicates the handle of the item  being expanded or collapsed.
Boolean A boolean expression that indicates whether the item is expanded or collapsed.

Use ExpandItem property to programmatically expand or collapse an item. Before expanding/collapsing an item, the control fires the BeforeExpandItem event. Use the BeforeExpandIvent to cancel expanding/collapsing of an item. After item was expanded/collapsed the control fires the AfterExpandItem event. The following samples shows how to expand the selected item: Group.Items.ExpandItem(Group.Items.SelectedItem()) = True. The property has no effect if the item has no child items. To check if the item has child items you can use ChildCount property.  

The following sample shows how to programmatically expand the selected item:

Private Sub ExplorerTree1_SelectionChanged(ByVal Group As EXPLORERTREELibCtl.IGroup)
    With Group.Items
        .ExpandItem(.SelectedItem()) = True
    End With
End Sub