GetAnnotationGroup Example VB

This example uses the AnnotationGroupCount property to determine the number of groups on an image.  Then it uses the GetAnnotationGroup method to get the group names.

Private Sub cmdListGroups_Click()
    Dim intNumGroups As Integer
    Dim strGroupName As String
    Dim intCount As Integer
    
    'find out how many groups are on the page
    intNumGroups = ImgEdit1.AnnotationGroupCount
    
    Load frmGroupList
    
    'Since index values of GetAnnotationGroup start with
    '0 have to loop one less than the number of groups
    For intCount = 0 To intNumGroups - 1
        strGroupName = ImgEdit1.GetAnnotationGroup(intCount)
        'write names of groups to a listbox
        frmGroupList.AnnoGroups.AddItem (strGroupName)
    Next intCount
    
    frmGroupList.Show
End Sub