'添加PageLayout中的浏览工具
sProgID = "esriControlTools.ControlsPageZoomInTool"
ToolbarControl1.AddItem sProgID, , , True, , esriCommandStyleIconOnly
sProgID = "esriControlTools.ControlsPageZoomOutTool"
ToolbarControl1.AddItem sProgID, , , False, , esriCommandStyleIconOnly
sProgID = "esriControlTools.ControlsPagePanTool"
ToolbarControl1.AddItem sProgID, , , False, , esriCommandStyleIconOnly
sProgID = "esriControlTools.ControlsPageZoomWholePageCommand"
ToolbarControl1.AddItem sProgID, , , False, , esriCommandStyleIconOnly
sProgID = "esriControlTools.ControlsPageZoomPageToLastExtentBackCommand"
ToolbarControl1.AddItem sProgID, , , False, , esriCommandStyleIconOnly
sProgID = "esriControlTools.ControlsPageZoomPageToLastExtentForwardCommand"
ToolbarControl1.AddItem sProgID, , , False, , esriCommandStyleIconOnly
'添加Map浏览工具
sProgID = "esriControlTools.ControlsMapZoomInTool"
ToolbarControl1.AddItem sProgID, , , True, , esriCommandStyleIconOnly
sProgID = "esriControlTools.ControlsMapZoomOutTool"
ToolbarControl1.AddItem sProgID, , , False, , esriCommandStyleIconOnly
sProgID = "esriControlTools.ControlsMapPanTool"
ToolbarControl1.AddItem sProgID, , , False, , esriCommandStyleIconOnly
sProgID = "esriControlTools.ControlsMapFullExtentCommand"
ToolbarControl1.AddItem sProgID, , , False, , esriCommandStyleIconOnly
''Add custom date tool
' sProgID = "EngineScenarioCommands.AddDateTool"
' ToolbarControl1.AddItem sProgID, , , True, , esriCommandStyleIconAndText
'创建新的菜单
Set m_pToolbarMenu = New ToolbarMenu
'在菜单中添加命令
sProgID = "esriControlTools.ControlsPageZoomInFixedCommand"
m_pToolbarMenu.AddItem sProgID, , , False, esriCommandStyleIconAndText
sProgID = "esriControlTools.ControlsPageZoomOutFixedCommand"
m_pToolbarMenu.AddItem sProgID, , , False, esriCommandStyleIconAndText
sProgID = "esriControlTools.ControlsPageZoomWholePageCommand"
m_pToolbarMenu.AddItem sProgID, , , False, esriCommandStyleIconAndText
sProgID = "esriControlTools.ControlsPageZoomPageToLastExtentBackCommand"
m_pToolbarMenu.AddItem sProgID, , , False, esriCommandStyleIconAndText
sProgID = "esriControlTools.ControlsPageZoomPageToLastExtentForwardCommand"
m_pToolbarMenu.AddItem sProgID, , , True, esriCommandStyleIconAndText
'设置联系
TOCControl1.SetBuddyControl PageLayoutControl1
ToolbarControl1.SetBuddyControl PageLayoutControl1
'把此菜单与PageLayoutControl挂钩
m_pToolbarMenu.SetHook PageLayoutControl1