|
找到一个自定义菜单的例子,但只能把Arcgis内部的按钮加载上去,不知怎么加自己创建的按钮,还望高手们指点下!
Option Explicit
'Implement the IMenuDef interface and IRootLevelMenu interface
Implements IMenuDef
Implements IRootLevelMenu ' Allows this menu to be added to the Menus category
' in the Customize dialog
Private Property Get IMenuDef_Caption() As String
' Set the string that appears as the menu's title
IMenuDef_Caption = "aa"
End Property
Private Sub IMenuDef_GetItemInfo(ByVal pos As Long, ByVal itemDef As esriSystemUI.IItemDef)
' Define the commands that will be on the menu. The built-in ArcMap AddData command,
' Full Extent command, and Fixed Zoom In command are added to this custom menu.
' ID is the ClassID of the command. Group determines whether the command
' begins a new group on the menu
Select Case pos
Case 0
itemDef.ID = "esriArcMapUI.AddDataCommand"
itemDef.Group = False
Case 1
itemDef.ID = "esriArcMapUI.FullExtentCommand"
itemDef.Group = True
Case 2
itemDef.ID = "esriArcMapUI.ZoomInFixedCommand"
itemDef.Group = False
Case 3
itemDef.ID = "esriArcMapUI.MxBookmarksMenu"
itemDef.Group = False
End Select
End Sub
Private Property Get IMenuDef_ItemCount() As Long
' Set how many commands will be on the menu
IMenuDef_ItemCount = 4
End Property
Private Property Get IMenuDef_Name() As String
' Set the internal name of the menu.
IMenuDef_Name = "a"
End Property
这里的itemDef.ID怎么才能取到自己创建的按钮的ID? |
|