AnnLock example for Visual Basic
Note: Also works with Access 95 and 97.
Note: This topic is for Document/Medical only.
'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 locks objects of type ANN_OBJECT_ELLIPSE using the key "IkeStarnes".
Private Sub AnnLock_Click()
Dim lType As Long
Dim a As Integer
Dim bSelected As Boolean
Dim uCount As Integer
Dim RasterVar As New LEADRasterVariant
'lock only the ellipse objects that are selected
bSelected = False
RasterAnn.AnnGetSelectCount
uCount = RasterAnn.AnnSelectCount 'get number of selected objects
RasterAnn.AnnGetSelectList RasterVar 'get the handles of the selected objects
For a = 1 To uCount
RasterAnn.AnnGetType RasterVar.LongItemValue(a - 1)
lType = RasterAnn.AnnType
If lType = ANN_OBJECT_ELLIPSE Then 'Is the object an ellipse?
bSelected = True
RasterAnn.AnnLock RasterVar.LongItemValue(a - 1), "IkeStarnes", False
End If
Next
If bSelected <> True Then
MsgBox "No Ellipse Objects were selected"
End If
End Sub