AnnSetGrouping example for Visual Basic

' This example will temporarily disable the grouping in all objects
' and re-enable the grouping later.

' disable grouping in all groups

LEAD1.AnnSetGrouping LEAD1.AnnContainer, False, ANNFLAG_RECURSE

… ' you can now select and change individual objects from groups
… ' you can also put the two calls to AnnSetGrouping in two
… ' buttons

' re-enable grouping all groups
' note that we do NOT enable grouping in the topmost container!
' if you enable the grouping in the top container, then all the 
' objects will act as a group!

LEAD1.AnnSetGrouping LEAD1.AnnContainer, True, ANNFLAG_RECURSE+ANNFLAG_NOTTHIS