AnnUnlock 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 is also the example for AnnGetLocked method.
'If an object is found to be locked, using AnnGetLocked method, the object is unlocked, by AnnUnlock, using the key "abcd".
'hGlobalAnn is a global handle to an annotation object
Private Sub AnnUnlock_Click()
Dim bLocked As Boolean
    RasterAnn.AnnGetLocked hGlobalAnn
    blocked = RasterAnn.AnnLocked
    If bLocked = True Then
        RasterAnn.AnnUnlock hGlobalAnn, "abcd"
    End If
End Sub