event AfterExpandItem (Group as Group, Item as HITEM)
Fired after an item is expanded (collapsed).

 TypeDescription 
   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 AfterExapndItem event notifies your application that an item is collapsed or expanded. Use the ExpandItem method to programmatically expand or collapse an item.  Use the BeforeExpandItem event to cancel expanding or collapsing items.

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
 


Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.