AnnAddUndoNode 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 creates two annotation notes as a single undo operation
Private Sub Command12_Click()
Dim hObject1 As Long
Dim hObject2 As Long
'Call the AddUndoNode method to add an undo node to the container.
RasterAnn.AnnAddUndoNode
'Disable the undo feature
RasterAnn.AnnUndoEnable = False
'Perform the operations to be combined into one undo.
RasterAnn.AnnCreate ANN_OBJECT_NOTE, True, True
hObject1 = RasterAnn.AnnObject
RasterAnn.AnnRectLeft (hObject1) = 0
RasterAnn.AnnRectTop (hObject1) = 0
RasterAnn.AnnRectWidth (hObject1) = 100
RasterAnn.AnnRectHeight (hObject1) = 100
RasterAnn.AnnCreate ANN_OBJECT_NOTE, True, True
hObject2 = RasterAnn.AnnObject
RasterAnn.AnnRectLeft(hObject2) = 0
RasterAnn.AnnRectTop(hObject2) = 100
RasterAnn.AnnRectWidth(hObject2) = 100
RasterAnn.AnnRectHeight(hObject2) = 100
'Re-enable the undo feature
RasterAnn.AnnUndoEnable = True
End Sub