AnnGetGrouping example for Visual Basic
'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar
'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1
'This example toggles the 'group' state of all objects in the main container
Private Sub Command15_Click()
Dim bGroup As Boolean
'Get current group state
bGroup = RasterAnn.AnnGetGrouping (RasterAnn.AnnContainer)
'Toggle the group state
RasterAnn.AnnSetGrouping RasterAnn.AnnContainer, Not bGroup, 0
'Display the group state
If RasterAnn.AnnGetGrouping(RasterAnn.AnnContainer) Then
MsgBox "Objects in AnnContainer are grouped"
Else
MsgBox "Objects in AnnContainer are not grouped"
End If
End Sub