AnnGetObjectFromTag example for Visual Basic
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 retrieves the annotation handle for any tag
Private Sub AnnGetObjectFromTag_Click()
Dim hTagObject As OLE_HANDLE
Dim sTag As String
Dim lTag As Long
sTag = InputBox("Which tag should I find?")
RasterAnn.AnnGetObjectFromTag RasterAnn.AnnContainer, CInt(sTag), False
hTagObject = RasterAnn.AnnTagObject
RasterAnn.AnnGetTag hTagObject
lTag = RasterAnn.AnnTag
If (CInt(sTag) = lTag) Then
MsgBox "Annotation Found with tag " & CInt(sTag) & ": " & Hex(hTagObject)
Else
MsgBox "Annotation NOT found with tag " & CInt(sTag)
End If
End Sub