clsmenu.cls

来自「这是一个非常全的VB+AO二次开发实例集」· CLS 代码 · 共 54 行

CLS
54
字号
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsmenu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
 Option Explicit
 
 'Implement the IMenuDef interface and IRootLevelMenu interface
 Implements IMenuDef
 Implements IRootLevelMenu
 
 Private Property Get IMenuDef_Caption() As String
     ' Set the string that appears as the menu's title
     IMenuDef_Caption = "MyMenu"
 End Property
 
 Private Sub IMenuDef_GetItemInfo(ByVal pos As Long, ByVal itemDef As esriCore.IItemDef)
     ' Define the commands that will be on the menu. The built-in ArcMap
     ' 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 = "esriCore.FullExtentCommand"
         itemDef.Group = True
     Case 1

         itemDef.ID = "promenu.clsmultitem"
         itemDef.Group = True
     Case 2
         itemDef.ID = "esriCore.ZoomInFixedCommand"
         itemDef.Group = True
     End Select
 
 End Sub
 
 Private Property Get IMenuDef_ItemCount() As Long
     ' Set how many commands will be on the menu
     IMenuDef_ItemCount = 3
 End Property
 
 Private Property Get IMenuDef_Name() As String
     ' Set the internal name of the menu.
     IMenuDef_Name = "MyMenu"
 End Property

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?