水世界-水处理技术社区(论坛)

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信登录

扫一扫,用微信登录

搜索
查看: 1780|回复: 2
打印 上一主题 下一主题

本例要实现的是如何创建定制的菜单(Menu)

[复制链接]

1万

积分

5860

金钱

4894

帖子

铂金水师

QQ
跳转到指定楼层
楼主
发表于 2007-9-23 19:30:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式



马上注册并关注水世界微信号,获得更多资料

您需要 登录 才可以下载或查看,没有帐号?注册   扫一扫,用微信登录

x
本例要实现的是如何创建定制的菜单(Menu) l 要点 用户通过在类模块中实现IMenuDef接口来创建定制的菜单(Menu),如果要使菜单出现在Customize Dialog的Menus类型中,必须同时实现IrootLevelMenu接口,它表明菜单为root menu。IMenuDef接口包括 Caption、ItemCount及Name三个属性和GetItemInfo方法。类似IToolBarDef(参照1.2.3) l 程序说明 程序在类模块中实现IMenuDef接口来创建定制的菜单(Menu)。 l 代码 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 = "promenu.clsmultitem" itemDef.Group = False Case 1 itemDef.ID = "esriCore.FullExtentCommand" itemDef.Group = True Case 2 itemDef.ID = "esriCore.ZoomInFixedCommand" 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 = 3 End Property Private Property Get IMenuDef_Name() As String ' Set the internal name of the menu. IMenuDef_Name = "MyMenu" End Property
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享分享 分享淘帖 支持支持 反对反对
清啦

16

积分

469

金钱

32

帖子

小小水师

沙发
发表于 2008-4-26 15:28:07 | 只看该作者
创建定制的菜单(Menu)

13

积分

12

金钱

25

帖子

小小水师

板凳
发表于 2008-5-20 10:19:49 | 只看该作者

向楼主学习

正需要一个菜单, 正好研究一下。
您需要登录后才可以回帖 登录 | 注册   扫一扫,用微信登录

本版积分规则

联系管理员|手机版|小黑屋|水世界-水处理技术社区(论坛) ( 京ICP备12048982号-4

GMT+8, 2025-6-10 14:59 , Processed in 0.276907 second(s), 37 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表