EditSelectedAnnotationText Example VB

This example uses the MarkSelect event and the EditSelectedAnnotationText method to allow the user to edit the text of an existing, selected annotation mark.

Private Sub ImgEdit1_MarkSelect(ByVal Button As Integer, ByVal Shift As Integer,
 ByVal Left As Long, ByVal Top As Long, ByVal Width As Long,
 ByVal Height As Long, ByVal MarkType As Integer,
 ByVal GroupName As String)
    'Dimension MarkLeft and MarkTop as global variables so these
    'values can be passed back to the EditSelectedAnnotationText method
        
    MarkLeft = Left
    MarkTop = Top

End Sub

Private Sub cmdEditText_Click()
    'This would allow the user to edit the text of an existing
    'selected annotation mark
   
    On Error GoTo HandleIt
    'Coordinates of the mark are obtained from the MarkSelect
    'event (see code above).
    ImgEdit1.EditSelectedAnnotationText MarkLeft, MarkTop

    Exit Sub

HandleIt:
     'Handle error if no mark is selected or the wrong type
     'of mark is selected
      MsgBox Err.Description
End Sub