Private Sub add bookmarks ToolStripMenuItem_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles add bookmarks ToolStripMenuItem. Click
Dim pMapBookMarks As IMapBookmarks
PMapBookMarks = Me. AxMapControl1.ActiveView. FocusMap
Dim pAOIBookMark As IAOIBookmark
PAOIBookMark = New AOIBookmark
PAOIBookMark. Location = Me. AxMapControl1.ActiveView. Extent
PMapBookMarks. AddBookmark (pAOIBookMark)
End Sub
Private Sub positioning bookmarks ToolStripMenuItem_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles positioning bookmarks ToolStripMenuItem. Click
Dim pMapBookMarks As IMapBookmarks
PMapBookMarks = Me. AxMapControl1.ActiveView. FocusMap
Dim pEnumSpatialBM As IEnumSpatialBookmark
PEnumSpatialBM = pMapBookMarks. Bookmarks
Dim pSpatialBM As ISpatialBookmark
'The first bookmarks are located here.
PSpatialBM = pEnumSpatialBM. Next
PSpatialBM. ZoomTo (Me. AxMapControl1.ActiveView. FocusMap)
Me. AxMapControl1.ActiveView. Refresh ()
End Sub
Private Sub Delete specified bookmarks ToolStripMenuItem_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Delete specified bookmarks ToolStripMenuItem. Click
Dim pMapBookMarks As IMapBookmarks
PMapBookMarks = Me. AxMapControl1.ActiveView. FocusMap
Dim pEnumSpatialBM As IEnumSpatialBookmark
PEnumSpatialBM = pMapBookMarks. Bookmarks
Dim pSpatialBM As ISpatialBookmark
'The first bookmarks are deleted here.
PSpatialBM = pEnumSpatialBM. Next
PMapBookMarks. RemoveBookmark (pSpatialBM)
End Sub
Private Sub delete all bookmarks ToolStripMenuItem_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles delete all bookmarks ToolStripMenuItem. Click
Dim pMapBookMarks As IMapBookmarks
PMapBookMarks = Me. AxMapControl1.ActiveView. FocusMap
PMapBookMarks. RemoveAllBookmarks ()
End Sub
Note that when we delete a tag, all the tags in the tag queue will be moved forward one by one, and the total number of tags will be reduced by one;
When tags are located, the sequence number before the tags are deleted remains the same, and the sequence number after the tags are deleted will be reduced by one