![]() | Type | Description | ||
| Group as Group | A Group object where the item is expanded or collapsed. | |||
| Item as HITEM | A long expression that indicates the item's handle that indicates the item expanded or collapsed. |
The following sample shows how to cancel expanding or collapsing items:
Private Sub ExplorerTree1_BeforeExpandItem(ByVal Group As EXPLORERTREELibCtl.IGroup, ByVal Item As EXPLORERTREELibCtl.HITEM, Cancel As Variant)
Cancel = True
End Sub
The following sample prints the item's state when it is expanded or collapsed:
Private Sub ExplorerTree1_AfterExpandItem(ByVal Group As EXPLORERTREELibCtl.IGroup, ByVal Item As EXPLORERTREELibCtl.HITEM)
Debug.Print "The " & Item & " item is " & IIf(Group.Items.ExpandItem(Item), "expanded", "collapsed")
End Sub