C# Code 1 2
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
private void 跳转书签ToolStripMenuItem_DropDownItemClicked (object sender, ToolStripItemClickedEventArgs e) {
IMapBookmarks bookmarks = axMapControl1.Map as IMapBookmarks; IEnumSpatialBookmark enumbookmark = bookmarks.Bookmarks; enumbookmark.Reset();
ISpatialBookmark spabookmark = enumbookmark.Next(); while (spabookmark != null)
{ if (e.ClickedItem.ToString() == ) {
spabookmark.ZoomTo((IMap)axMapControl1.ActiveView); axMapControl1.ActiveView.Refresh(); break; }
spabookmark = enumbookmark.Next(); } }
运行程序,如图方式添加书签