AnnHyperlink 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

Private Sub RasterAnn_OnAnnHyperLink(ByVal hObject As Long, ByVal iParamCount As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long, ByVal lParam3 As Long, ByVal lParam4 As Long, ByVal lParam5 As Long)
 Dim msgstr As String
 Dim nType As Integer
    
    RasterAnn.AnnGetHyperlinkType hObject
    nType = RasterAnn.AnnHyperlinkType
    If ((nType = ANN_LINK_ANNEVENT5) Or (nType = ANN_LINK_ANNEVENT)) Then
        If iParamCount >= 0 Then
            msgstr = CStr(iParamCount) & " params are valid" & Chr(13)
        End If
        If iParamCount >= 1 Then
            msgstr = msgstr & "Param1: " & CStr(lParam1) & Chr(13)
        End If
        If iParamCount >= 2 Then
            msgstr = msgstr & "Param2: " & CStr(lParam2) & Chr(13)
        End If
        If iParamCount >= 3 Then
            msgstr = msgstr & "Param3: " & CStr(lParam3) & Chr(13)
        End If
        If iParamCount >= 4 Then
            msgstr = msgstr & "Param4: " & CStr(lParam4) & Chr(13)
        End If
        If iParamCount = 5 Then
            msgstr = msgstr & "Param5: " & CStr(lParam5) & Chr(13)
        End If
    Else
        msgstr = "Invalid Type"
    End If
    MsgBox msgstr
End Sub