AnnGetGrouping example for Visual Basic
' This example will toggle the grouping feature for all
' the subcontainers
' This event is fired for each annotation
' Toggles the Grouping feature for all the containers
Private Sub LEAD1_AnnEnumerate(ByVal hObject As Stdole.OLE_HANDLE)
If LEAD1.AnnGetType(hObject) = ANNOBJECT_CONTAINER Then
LEAD1.AnnSetGrouping hObject, Not LEAD1.AnnGetGrouping(hObject),0
End If
End Sub
' Add subcontainers by selecting objects and grouping them
' before clicking on this button
' Note that after you disable the grouping you can select and change
' individual objects belonging to a group. When you re-enable
' the grouping, the objects act as a group again.
Private Sub Command1_Click()
LEAD1.AnnUserMode = ANNUSERMODE_DESIGN
LEAD1.AnnEnumerate LEAD1.AnnContainer, ANNFLAG_RECURSE + ANNFLAG_NOTTHIS, ""
End Sub